summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>1999-10-28 20:41:24 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>1999-10-28 20:41:24 +0000
commitab4c7bcd2aac4459afdb7c4f15baa77f44dec67b (patch)
treea043aafb6b90153a40b7e79a6c9fd1cc7f12f124 /usr.bin
parent285f8809474ef89dec537b3b4c39c14d080002d1 (diff)
call setsid() regardless of argv[]
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/ssh-agent.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c
index d6f48740ca7..d304e7a670b 100644
--- a/usr.bin/ssh/ssh-agent.c
+++ b/usr.bin/ssh/ssh-agent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-agent.c,v 1.15 1999/10/28 08:43:10 markus Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.16 1999/10/28 20:41:23 markus Exp $ */
/*
@@ -16,7 +16,7 @@ The authentication agent program.
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-agent.c,v 1.15 1999/10/28 08:43:10 markus Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.16 1999/10/28 20:41:23 markus Exp $");
#include "ssh.h"
#include "rsa.h"
@@ -650,11 +650,17 @@ main(int ac, char **av)
close(1);
close(2);
- if (ac == 0 && setsid() == -1)
- cleanup_exit(1);
+ if (setsid() == -1)
+ {
+ perror("setsid");
+ cleanup_exit(1);
+ }
if (atexit(cleanup_socket) < 0)
- cleanup_exit(1);
+ {
+ perror("atexit");
+ cleanup_exit(1);
+ }
new_socket(AUTH_SOCKET, sock);
if (ac > 0)