updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / ulatencyd / std.patch
blobf9c8489ec80c594017adbb481c6e621cf8b0f2f0
1 diff -aur ulatencyd-0.5.0/src/ulatencyd.c ulatencyd-0.5.0.patched/src/ulatencyd.c
2 --- ulatencyd-0.5.0/src/ulatencyd.c 2011-04-05 19:01:20.000000000 +0200
3 +++ ulatencyd-0.5.0.patched/src/ulatencyd.c 2011-12-18 04:40:06.000000000 +0100
4 @@ -463,6 +463,7 @@
6 GError *error = NULL;
7 GOptionContext *context;
8 + int i = 0;
10 // required for dbus
11 g_type_init ();
12 @@ -501,10 +502,11 @@
13 if (sid < 0) {
14 exit (1);
17 - close(STDIN_FILENO);
18 - close(STDOUT_FILENO);
19 - close(STDERR_FILENO);
20 + // ensure std* exist but do nothing
21 + i=open("/dev/null",O_RDWR);
22 + dup2(i, STDIN_FILENO);
23 + dup2(i, STDOUT_FILENO);
24 + dup2(i, STDERR_FILENO);
27 load_config();