kill() might overwrite errno. Save it beforehand
authorAlexandra Ellwood <lxs@mit.edu>
Tue, 2 Sep 2003 18:37:12 +0000 (18:37 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Tue, 2 Sep 2003 18:37:12 +0000 (18:37 +0000)
ticket: 1799

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15806 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm5/srv/svr_principal.c

index 0666fe62b2b01b0c0d7a562a286eda28044174d4..c567f83690ba1323798c20bc0666f0e0f03889d2 100644 (file)
@@ -1138,8 +1138,8 @@ kadm5_launch_task (krb5_context context,
                 if (krb5_net_write (context, data_pipe[1],
                                     data_buffer, strlen (data_buffer)) < 0) {
                     /* kill the child to make sure waitpid() won't hang later */
-                    kill (pid, SIGKILL);
                     ret = errno;
+                    kill (pid, SIGKILL);
                 }
             }