Re: wait-process cosmetics

Bruno Haible <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
Eric Blake wrote:

>    /* waitpid() is just as portable as wait() nowadays.  */
> -  int status;
> +  int status = 0;
> 
>    if (termsigp != NULL)
>      *termsigp = 0;
> -  *(int *) &status = 0;
>    for (;;)
>      {

Applied as follows:


2009-03-01  Eric Blake  <[email protected]>

	* lib/wait-process.c (wait_subprocess): Remove unnecessary cast.

--- lib/wait-process.c.orig	2009-03-01 17:59:34.000000000 +0100
+++ lib/wait-process.c	2009-03-01 17:58:16.000000000 +0100
@@ -1,5 +1,5 @@
 /* Waiting for a subprocess to finish.
-   Copyright (C) 2001-2003, 2005-2008 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -292,7 +292,7 @@
 
   if (termsigp != NULL)
     *termsigp = 0;
-  *(int *) &status = 0;
+  status = 0;
   for (;;)
     {
       int result = waitpid (child, &status, 0);
@@ -308,7 +308,7 @@
 	    {
 	      /* Child process nonexistent?! Assume it terminated
 		 successfully.  */
-	      *(int *) &status = 0;
+	      status = 0;
 	      break;
 	    }
 # endif
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.