Re: [ccan] [PATCH v2 01/13] configurator: Replace unlink with remove

2016-09-26 Thread David Gibson
On Thu, Sep 22, 2016 at 09:33:04PM -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 
> Reviewed-by: David Gibson 

This is sane enough on its own, so I'll apply it to master.

> ---
>  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


signature.asc
Description: PGP signature
___
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan


[ccan] [PATCH v2 01/13] configurator: Replace unlink with remove

2016-09-22 Thread Kevin Locke
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 
Reviewed-by: David Gibson 
---
 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"
-- 
2.9.3

___
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan