SHA256
3
0
forked from pool/aaa_base

Accepting request 44084 from home:elvigia:branches:Base:System

Copy from home:elvigia:branches:Base:System/aaa_base via accept of submit request 44084 revision 2.
Request was accepted with message:
Reviewed ok

OBS-URL: https://build.opensuse.org/request/show/44084
OBS-URL: https://build.opensuse.org/package/show/Base:System/aaa_base?expand=0&rev=130
This commit is contained in:
Pavol Rusnak 2010-07-29 06:20:23 +00:00 committed by Git OBS Bridge
parent 0091bb59e4
commit 26599f2c00
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Jul 27 15:34:59 UTC 2010 - cristian.rodriguez@opensuse.org
- get_kernel_version : use O_CLOEXEC everywhere
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jul 16 17:22:27 CEST 2010 - werner@suse.de Fri Jul 16 17:22:27 CEST 2010 - werner@suse.de

View File

@ -14,6 +14,7 @@
along with this program; if not, write to the Free Software Foundation, along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define _GNU_SOURCE
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
@ -47,7 +48,7 @@ main (int argc, char *argv[])
/* check if file exist and is compressed */ /* check if file exist and is compressed */
{ {
unsigned char buf [2]; unsigned char buf [2];
int fd = open (argv[1], O_RDONLY); int fd = open (argv[1], O_RDONLY | O_CLOEXEC);
if (fd == -1) if (fd == -1)
{ {
fprintf (stderr, "Cannot open kernel image \"%s\"\n", argv[1]); fprintf (stderr, "Cannot open kernel image \"%s\"\n", argv[1]);
@ -64,7 +65,7 @@ main (int argc, char *argv[])
if (buf [0] == 037 && (buf [1] == 0213 || buf [1] == 0236)) if (buf [0] == 037 && (buf [1] == 0213 || buf [1] == 0236))
{ {
snprintf (command, sizeof (command), "/bin/gzip -dc %s 2>/dev/null", argv[1]); snprintf (command, sizeof (command), "/bin/gzip -dc %s 2>/dev/null", argv[1]);
fp = popen (command, "r"); fp = popen (command, "re");
if (fp == NULL) if (fp == NULL)
{ {
fprintf (stderr, "%s: faild\n", command); fprintf (stderr, "%s: faild\n", command);
@ -73,7 +74,7 @@ main (int argc, char *argv[])
} }
else else
{ {
fp = fopen (argv[1],"r"); fp = fopen (argv[1],"re");
} }
close (fd); close (fd);
} }