Fix bug #5121 (unix passwd sync bnot working on a streams based
[tprouty/samba.git] / source / smbd / chgpasswd.c
index b4b60f1dbc3e8d384006655877ba4ab6078507ca..2a4d96598ba236d6941e5796d531c5463eeebfc3 100644 (file)
@@ -154,19 +154,19 @@ static int dochild(int master, const char *slavedev, const struct passwd *pass,
                DEBUG(3, ("More weirdness, could not open %s\n", slavedev));
                return (False);
        }
-#if defined(I_PUSH) && defined(I_FIND)
+#if defined(TIOCSCTTY)
+       if (ioctl(slave, TIOCSCTTY, 0) < 0)
+       {
+               DEBUG(3, ("Error in ioctl call for slave pty\n"));
+               /* return(False); */
+       }
+#elif defined(I_PUSH) && defined(I_FIND)
        if (ioctl(slave, I_FIND, "ptem") == 0) {
                ioctl(slave, I_PUSH, "ptem");
        }
        if (ioctl(slave, I_FIND, "ldterm") == 0) {
                ioctl(slave, I_PUSH, "ldterm");
        }
-#elif defined(TIOCSCTTY)
-       if (ioctl(slave, TIOCSCTTY, 0) < 0)
-       {
-               DEBUG(3, ("Error in ioctl call for slave pty\n"));
-               /* return(False); */
-       }
 #endif
 
        /* Close master. */