chiark / gitweb /
systemctl: fix opening params
[elogind.git] / src / systemctl.c
index 66903aba28a5a1c276e081fa65a9a713be0e93ea..c09b31d1df08ed48892f6cb4c0eb0f97d9c2129d 100644 (file)
@@ -141,6 +141,9 @@ static void spawn_ask_password_agent(void) {
         if (!arg_ask_password)
                 return;
 
+        if (arg_user)
+                return;
+
         parent = getpid();
 
         /* Spawns a temporary TTY agent, making sure it goes away when
@@ -177,7 +180,7 @@ static void spawn_ask_password_agent(void) {
                  * call that expects to read EOF we actually do
                  * generate EOF and not delay this indefinitely by
                  * because we keep an unused copy of stdin around. */
-                if ((fd = open("/dev/tty", O_RDWR|O_CLOEXEC|O_NONBLOCK)) < 0) {
+                if ((fd = open("/dev/tty", O_RDWR)) < 0) {
                         log_error("Failed to open /dev/tty: %m");
                         _exit(EXIT_FAILURE);
                 }