Re: [PATCH 1/9] configurator: Replace unlink with remove

David Gibson <[email protected]> Tue, 20 Sep 2016 14:50:33 +1000
Newsgroups org.ozlabs.lists.ccan
Message-ID <20160920045033.GK20488@umbus>
On Sun, Sep 18, 2016 at 06:51:58PM -0600, Kevin Locke wrote:
> Although Windows provides unlink, using it adds complication due to the
> lack of unistd.h which must be included to define the function on POSIX
> systems.  Instead, use remove, which C89 requires to be in stdio.h.
> 
> Signed-off-by: Kevin Locke <[email protected]>

Reviewed-by: David Gibson <[email protected]>

> ---
>  tools/configurator/configurator.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c
> index 67dadc6..e322c76 100644
> --- a/tools/configurator/configurator.c
> +++ b/tools/configurator/configurator.c
> @@ -639,8 +639,8 @@ int main(int argc, const char *argv[])
>  		run_test(cmd, &tests[i]);
>  	free(cmd);
>  
> -	unlink(OUTPUT_FILE);
> -	unlink(INPUT_FILE);
> +	remove(OUTPUT_FILE);
> +	remove(INPUT_FILE);
>  
>  	printf("/* Generated by CCAN configurator */\n"
>  	       "#ifndef CCAN_CONFIG_H\n"

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

_______________________________________________
ccan mailing list
[email protected]
https://lists.ozlabs.org/listinfo/ccan
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJX4MAZAAoJEGw4ysog2bOSE7wQAOFTfTfdzNdsQa5fz0ZjYr06
LGnw9v0gF1Yx/DW0k2d89R5fZ/MD+rtuPeCSbP+W3odBmezJfpGc53jaGHS6TJMj
HVXWoKYWuL0VlbZgiiwqr6FER0gS3uo1WQLyV/cp51oaS8kBG3nHiTS9heJdJqbT
ZosygP1ebWxwo5Okd8DokPpCrwxShFuKo+5vhf7VkTgxQhVe3Cu5FY3E3QiOsj5A
h6uZ+DuX7OpAKU0yIBnsYu97SxQzIeDuKUD3vKrPWT2JgPW63PMcQrfE41H+9OmU
zDHaq8YpKOpA7bpTWCe5JdkQ68wQFRC2c3MHGc3dbDh8g4Y+q8PJxNAUh30QCSAD
OdpOGEGwpt1JifxGI1givYSpYJNSEVTkmGGL7pHXmwLGZh/c7WZTkHdUzdYuv92O
hAXygT5obPqFLPtlXg0DLWIlyqmuwDCDkOXvgrkovVrJGDag4Cw55RpW6YJEXZDu
WctTWieYtlBV3QK5REyf7k+BH15b6E7TSz8c+heVD5NPGGEwISDqT4tVIX2cGx8F
9FZxr7MsQldhXvLVXNT6AqNfScE1ca7G673Gd2eyIZNKJCuxwKocwlg5EA7RcPoW
sP0jUAUryCDuAeerth2sGzNR3vBSRafLqSOgNEr/dD/q13020n/NhS/51gWXX44L
riDdxHxmXEy4I1rTUAvf
=fYqU
-----END PGP SIGNATURE-----