Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 175910 Details for
Bug 168201
app-misc/beep-1.3 - Could not open /dev/tty0 or /dev/vc/0 for writing
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed new nosuid patch
nosuid.patch (text/plain), 1.61 KB, created by
Christopher Head
on 2008-12-20 00:18:06 UTC
(
hide
)
Description:
Proposed new nosuid patch
Filename:
MIME Type:
Creator:
Christopher Head
Created:
2008-12-20 00:18:06 UTC
Size:
1.61 KB
patch
obsolete
>--- beep.c.orig 2008-12-19 16:16:20.000000000 -0800 >+++ beep.c 2008-12-19 16:15:51.000000000 -0800 >@@ -220,25 +220,28 @@ > /* try to snag the console */ > if((console_fd = open("/dev/console", O_WRONLY)) == -1) { > fprintf(stderr, "Could not open /dev/console for writing.\n"); >- printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ > perror("open"); >- exit(1); > } > > /* Beep */ > for (i = 0; i < parms.reps; i++) { /* start beep */ >- if(ioctl(console_fd, KIOCSOUND, (int)(CLOCK_TICK_RATE/parms.freq)) < 0) { >- printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ >- perror("ioctl"); >- } >+ if (console_fd >= 0) >+ if(ioctl(console_fd, KIOCSOUND, (int)(CLOCK_TICK_RATE/parms.freq)) < 0) { >+ fprintf(stderr, "\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ >+ perror("ioctl"); >+ } >+ else >+ fprintf(stderr, "\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ > /* Look ma, I'm not ansi C compatible! */ > usleep(1000*parms.length); /* wait... */ >- ioctl(console_fd, KIOCSOUND, 0); /* stop beep */ >+ if (console_fd >= 0) >+ ioctl(console_fd, KIOCSOUND, 0); /* stop beep */ > if(parms.end_delay || (i+1 < parms.reps)) > usleep(1000*parms.delay); /* wait... */ > } /* repeat. */ > >- close(console_fd); >+ if (console_fd >= 0) >+ close(console_fd); > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 168201
:
175585
| 175910 |
410544