49 lines
1.2 KiB
Diff
49 lines
1.2 KiB
Diff
|
--- synergy-1.3.1/lib/arch/CArchDaemonUnix.cpp
|
||
|
+++ synergy-1.3.1/lib/arch/CArchDaemonUnix.cpp
|
||
|
@@ -57,7 +57,8 @@
|
||
|
setsid();
|
||
|
|
||
|
// chdir to root so we don't keep mounted filesystems points busy
|
||
|
- chdir("/");
|
||
|
+ if(chdir("/") < 0)
|
||
|
+ perror("chdir(/)");
|
||
|
|
||
|
// mask off permissions for any but owner
|
||
|
umask(077);
|
||
|
@@ -71,7 +72,8 @@
|
||
|
// of standard I/O safely goes in the bit bucket.
|
||
|
open("/dev/null", O_RDONLY);
|
||
|
open("/dev/null", O_RDWR);
|
||
|
- dup(1);
|
||
|
+ if(dup(1) < 0)
|
||
|
+ perror("dup(1)");
|
||
|
|
||
|
// invoke function
|
||
|
return func(1, &name);
|
||
|
--- synergy-1.3.1/lib/arch/CArchNetworkBSD.cpp
|
||
|
+++ synergy-1.3.1/lib/arch/CArchNetworkBSD.cpp
|
||
|
@@ -326,7 +326,9 @@
|
||
|
// the unblock event was signalled. flush the pipe.
|
||
|
char dummy[100];
|
||
|
do {
|
||
|
- read(unblockPipe[0], dummy, sizeof(dummy));
|
||
|
+ if(read(unblockPipe[0], dummy, sizeof(dummy)) < 0) {
|
||
|
+ perror("read()");
|
||
|
+ }
|
||
|
} while (errno != EAGAIN);
|
||
|
|
||
|
// don't count this unblock pipe in return value
|
||
|
@@ -498,7 +500,9 @@
|
||
|
const int* unblockPipe = getUnblockPipeForThread(thread);
|
||
|
if (unblockPipe != NULL) {
|
||
|
char dummy = 0;
|
||
|
- write(unblockPipe[1], &dummy, 1);
|
||
|
+ if(write(unblockPipe[1], &dummy, 1) < 0) {
|
||
|
+ perror("write()");
|
||
|
+ }
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|