Re: [libvirt] [PATCH] tests: Don't ignore return value of getcwd()
tests/commandhelper.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) ACK. Pushed too, thanks. Jirka -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] tests: Don't ignore return value of getcwd()
--- tests/commandhelper.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index 2ee9153..5b2f301 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -97,7 +97,8 @@ int main(int argc, char **argv) { fprintf(log, DAEMON:%s\n, getppid() == 1 ? yes : no); char cwd[1024]; -getcwd(cwd, sizeof(cwd)); +if (!getcwd(cwd, sizeof(cwd))) +return EXIT_FAILURE; if (strlen(cwd) strlen(/commanddata) STREQ(cwd + strlen(cwd) - strlen(/commanddata), /commanddata)) strcpy(cwd, .../commanddata); -- 1.7.3.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] tests: Don't ignore return value of getcwd()
On 12/03/2010 09:11 AM, Jiri Denemark wrote: --- tests/commandhelper.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) ACK. diff --git a/tests/commandhelper.c b/tests/commandhelper.c index 2ee9153..5b2f301 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -97,7 +97,8 @@ int main(int argc, char **argv) { fprintf(log, DAEMON:%s\n, getppid() == 1 ? yes : no); char cwd[1024]; -getcwd(cwd, sizeof(cwd)); +if (!getcwd(cwd, sizeof(cwd))) +return EXIT_FAILURE; if (strlen(cwd) strlen(/commanddata) STREQ(cwd + strlen(cwd) - strlen(/commanddata), /commanddata)) strcpy(cwd, .../commanddata); -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list