summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/samr/srv_samr_chgpasswd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/rpc_server/samr/srv_samr_chgpasswd.c b/source3/rpc_server/samr/srv_samr_chgpasswd.c
index 51c0d0f96a..3d04899a53 100644
--- a/source3/rpc_server/samr/srv_samr_chgpasswd.c
+++ b/source3/rpc_server/samr/srv_samr_chgpasswd.c
@@ -74,7 +74,8 @@ static int findpty(char **slave)
#if defined(HAVE_GRANTPT)
/* Try to open /dev/ptmx. If that fails, fall through to old method. */
- if ((master = open("/dev/ptmx", O_RDWR, 0)) >= 0) {
+ master = open("/dev/ptmx", O_RDWR, 0);
+ if (master >= 0) {
grantpt(master);
unlockpt(master);
line = (char *)ptsname(master);