*** empty log message ***
authorroot <root>
Sun, 22 Jan 2006 16:36:40 +0000 (16:36 +0000)
committerroot <root>
Sun, 22 Jan 2006 16:36:40 +0000 (16:36 +0000)
src/fdpass.C
src/libptytty.h
src/rxvtc.C

index bf4f38cc81c05e43ec982655c2f073cda0b00655..05438fdea3dfdc0e7545d5ee1f15f6a9fba83440 100644 (file)
@@ -35,7 +35,7 @@
 # define CMSG_LEN(len) (sizeof (cmsghdr) + len)
 #endif
 
-int
+bool
 ptytty::send_fd (int socket, int fd)
 {
   msghdr msg;
@@ -62,7 +62,7 @@ ptytty::send_fd (int socket, int fd)
 
   msg.msg_controllen = cmsg->cmsg_len;
 
-  return sendmsg (socket, &msg, 0);
+  return sendmsg (socket, &msg, 0) >= 0;
 }
 
 int
index b7f6c1c44e39d5bc36492691f791827d6b577ac4..b8af01d2fc731a7fca0d0aa3d7f07c1a416c373f 100644 (file)
@@ -25,7 +25,7 @@ struct ptytty {
   static void drop_privileges ();
   static void use_helper ();
 
-  static int send_fd (int socket, int fd);
+  static bool send_fd (int socket, int fd);
   static int recv_fd (int socket);
 
 protected:
index 417a855185fc4bc794ee0c3985179cc73a88c9c6..0dd2d1c7b304682db275f0762ba143e5773af78a 100644 (file)
@@ -112,7 +112,7 @@ main (int argc, const char *const *argv)
       fprintf (stderr, "%s", (const char *)tok);
     else if (!strcmp (tok, "GETFD") && c.recv (cint))
       {
-        if (ptytty::send_fd (c.fd, cint) < 0)
+        if (!ptytty::send_fd (c.fd, cint))
           {
             fprintf (stderr, "unable to send fd %d: ", cint); perror (0);
             exit (EXIT_FAILURE);