Attribute warn_unused_result

Alex Merry alexander.merry at ccc.ox.ac.uk
Fri Aug 25 07:48:14 PDT 2006


On Fri, Aug 25, 2006 at 01:00:33PM +0100, Alex Merry wrote:
> diff -urw make-3.81.old/main.c make-3.81/main.c
> --- make-3.81.old/main.c	2006-08-25 12:48:20.000000000 +0100
> +++ make-3.81/main.c	2006-08-25 12:50:07.000000000 +0100
> @@ -3066,7 +3066,8 @@
>  	 directory.  Must wait until after remove_intermediates(), or unlinks
>           of relative pathnames fail.  */
>        if (directory_before_chdir != 0)
> -	chdir (directory_before_chdir);
> +        if (chdir (directory_before_chdir) != -1)
> +          error (NILF, "Failed to return to original directory %s", directory_before_chdir);
>  
>        log_working_directory (0);
>      }

OK, that != should be == in the patch. Better one attached.

Alex :-)


-- 
Pippin
Computer Monkey to the Pelican
www.oxrev.org.uk, www.corpusjcr.org, www.rev.org.uk
-------------- next part --------------
diff -urw make-3.81.old/main.c make-3.81/main.c
--- make-3.81.old/main.c	2006-08-25 12:48:20.000000000 +0100
+++ make-3.81/main.c	2006-08-25 12:50:07.000000000 +0100
@@ -3066,7 +3066,8 @@
 	 directory.  Must wait until after remove_intermediates(), or unlinks
          of relative pathnames fail.  */
       if (directory_before_chdir != 0)
-	chdir (directory_before_chdir);
+        if (chdir (directory_before_chdir) == -1)
+          error (NILF, "Failed to return to original directory %s", directory_before_chdir);
 
       log_working_directory (0);
     }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/hlfs-dev/attachments/20060825/2c35df5a/attachment.sig>


More information about the hlfs-dev mailing list