ALT Linux Bugzilla
– Attachment 1615 Details for
Bug 6257
irattach logs bad error message on TIOCSETD failure
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
irda-utils-0.9.16-alt-irattach-daemonize.patch
irda-utils-0.9.16-alt-irattach-daemonize.patch (text/plain), 844 bytes, created by
Sergey Vlasov
on 2006-09-02 23:55:59 MSD
(
hide
)
Description:
irda-utils-0.9.16-alt-irattach-daemonize.patch
Filename:
MIME Type:
Creator:
Sergey Vlasov
Created:
2006-09-02 23:55:59 MSD
Size:
844 bytes
patch
obsolete
>--- irda-utils-0.9.16/irattach/util.c.alt-irattach-daemonize 2004-04-01 01:55:41 +0400 >+++ irda-utils-0.9.16/irattach/util.c 2006-09-02 23:47:40 +0400 >@@ -158,6 +158,7 @@ void fork_now(int ttyfd) > { > int ret; > int i; >+ int fd; > > if ((ret = fork()) > 0) > exit(0); >@@ -173,10 +174,23 @@ void fork_now(int ttyfd) > } > > /* Close all open inherited files! Except for ttyfd! */ >- for (i = 0; i < 64; i++) >+ for (i = 0; i < sysconf(_SC_OPEN_MAX); i++) > if(i != ttyfd) > close(i); > >+ /* Redirect standard descriptors to /dev/null to avoid trouble */ >+ fd = open("/dev/null", O_RDWR); >+ if (fd >= 0) { >+ if (fd != STDIN_FILENO) >+ dup2(fd, STDIN_FILENO); >+ if (fd != STDOUT_FILENO) >+ dup2(fd, STDOUT_FILENO); >+ if (fd != STDERR_FILENO) >+ dup2(fd, STDERR_FILENO); >+ if (fd > STDERR_FILENO) >+ close(fd); >+ } >+ > write_pid(); > } >
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 6257
: 1615