picview/png, my_popen: fix -Wclobbered warnings

Origin commit data
------------------
Branch: ni/coolstream
Commit: fe5a6ec111
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2015-01-26 (Mon, 26 Jan 2015)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2015-01-26 19:30:23 +01:00
committed by Jacek Jendrzej
parent a1cc8dc08a
commit 552334b652
2 changed files with 6 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
License: GPL
(C) 2012-2013 the neutrino-hd developers
(C) 2012,2013 Stefan Seyfried
(C) 2012-2015 Stefan Seyfried
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -110,7 +110,7 @@ int my_system(const char * cmd)
int my_system(int argc, const char *arg, ...)
{
int i = 0, ret = 0, childExit = 0;
int i = 0, ret, childExit = 0;
#define ARGV_MAX 64
/* static right now but could be made dynamic if necessary */
int argv_max = ARGV_MAX;
@@ -141,6 +141,7 @@ int my_system(int argc, const char *arg, ...)
ret = -errno;
break;
case 0: /* child process */
ret = 0;
for(i = 3; i < maxfd; i++)
close(i);
if (setsid() == -1)
@@ -153,6 +154,7 @@ int my_system(int argc, const char *arg, ...)
}
_exit(ret); // terminate c h i l d proces s only
default: /* parent returns to calling process */
ret = 0;
waitpid(pid, &childExit, 0);
if (WEXITSTATUS(childExit) != 0)
ret = (signed char)WEXITSTATUS(childExit);