summaryrefslogtreecommitdiff
path: root/imap-send.c
diff options
context:
space:
mode:
authorPaul T Darga <pdarga@umich.edu>2006-06-08 18:14:47 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-08 18:57:00 (GMT)
commitc9bc159d7f41e2916830b05529c1ce06a81d975f (patch)
treedd3d17965ec8c97357f0a15d97455f0f4c6b30be /imap-send.c
parentfb6a9f93d39e4e5fdb83673a927f71a34e9fb7c0 (diff)
downloadgit-c9bc159d7f41e2916830b05529c1ce06a81d975f.zip
git-c9bc159d7f41e2916830b05529c1ce06a81d975f.tar.gz
git-c9bc159d7f41e2916830b05529c1ce06a81d975f.tar.bz2
check for error return from fork()
Trivial fixup for fork() callsites which do not check for errors. Signed-off-by: Paul T Darga <pdarga@umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'imap-send.c')
-rw-r--r--imap-send.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/imap-send.c b/imap-send.c
index 52e2400..285ad29 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -924,6 +924,7 @@ imap_open_store( imap_server_conf_t *srvc )
struct hostent *he;
struct sockaddr_in addr;
int s, a[2], preauth;
+ pid_t pid;
ctx = xcalloc( sizeof(*ctx), 1 );
@@ -941,7 +942,10 @@ imap_open_store( imap_server_conf_t *srvc )
exit( 1 );
}
- if (fork() == 0) {
+ pid = fork();
+ if (pid < 0)
+ _exit( 127 );
+ if (!pid) {
if (dup2( a[0], 0 ) == -1 || dup2( a[0], 1 ) == -1)
_exit( 127 );
close( a[0] );