Revision: 7442
Author:   nogu.dev
Date:     Sat Feb 11 02:10:35 2012
Log:      * uim/uim-helper-server.c
  - (init_server_fd): Check return value of fchown().
http://code.google.com/p/uim/source/detail?r=7442

Modified:
 /trunk/uim/uim-helper-server.c

=======================================
--- /trunk/uim/uim-helper-server.c      Wed Jan 11 00:17:24 2012
+++ /trunk/uim/uim-helper-server.c      Sat Feb 11 02:10:35 2012
@@ -105,8 +105,11 @@
   logname = getenv("LOGNAME");
   if (logname) {
     pw = getpwnam(logname);
-    if (pw)
-      fchown(fd, pw->pw_uid, -1);
+    if (pw) {
+      if (fchown(fd, pw->pw_uid, -1) == -1) {
+        return -1;
+      }
+    }
   }

   if ((flag = fcntl(fd, F_GETFL)) < 0) {

Reply via email to