aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_util.c
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2013-01-30 16:49:25 -0600
committerPeter Seebach <peter.seebach@windriver.com>2013-01-30 16:54:03 -0600
commita14fe9df8a7eefdb9b82dcefd5960a8a86e53738 (patch)
tree07d1fa140b60cd9f1e70e7b18499be568036675e /pseudo_util.c
parent2f56acf04e85cfd617eaded954c1ce40403d7f66 (diff)
downloadpseudo-a14fe9df8a7eefdb9b82dcefd5960a8a86e53738.tar.gz
pseudo-a14fe9df8a7eefdb9b82dcefd5960a8a86e53738.tar.bz2
pseudo-a14fe9df8a7eefdb9b82dcefd5960a8a86e53738.zip
Remove a couple of highly non-obvious GLIBC_2.7 dependencies.
There were a couple of cases where pseudo built against GLIBC_2.7 or newer was ending up with dependencies on symbols which required GLIBC_2.7. With these gone, it appears that a libpseudo.so can be used on an older host in some cases. None were particularly important or intentional: 1. pseudo_util was conditionally calling open() with only two arguments, which can invoke a new __open2() function in some systems. Don't care, and the docs specifically state that the mode argument is "ignored" when O_CREAT is absent, so it's not necessary to omit it. 2. The calls to sscanf/fscanf in pseudo_client.c were getting translated into a special new iso_c99 sscanf/fscanf, and we don't care because we're not using those features; #define _GNU_SOURCE suppresses the extra-compliant behavior. Signed-off-by: seebs <peter.seebach@windriver.com>
Diffstat (limited to 'pseudo_util.c')
-rw-r--r--pseudo_util.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/pseudo_util.c b/pseudo_util.c
index 95844fa..ca2f0a4 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -1,7 +1,7 @@
/*
* pseudo_util.c, miscellaneous utility functions
*
- * Copyright (c) 2008-2010 Wind River Systems, Inc.
+ * Copyright (c) 2008-2013 Wind River Systems, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the Lesser GNU General Public License version 2.1 as
@@ -1244,11 +1244,7 @@ pseudo_etc_file(const char *file, char *realname, int flags, char **search_dirs,
continue;
snprintf(filename, pseudo_path_max(), "%s/etc/%s",
s, file);
- if (flags & O_CREAT) {
- rc = open(filename, flags, 0600);
- } else {
- rc = open(filename, flags);
- }
+ rc = open(filename, flags, 0600);
if (rc >= 0) {
if (realname)
strcpy(realname, filename);
@@ -1275,11 +1271,7 @@ pseudo_etc_file(const char *file, char *realname, int flags, char **search_dirs,
snprintf(filename, pseudo_path_max(), "/etc/%s", file);
pseudo_debug(2, "falling back on <%s> for <%s>\n",
filename, file);
- if (flags & O_CREAT) {
- rc = open(filename, flags, 0600);
- } else {
- rc = open(filename, flags);
- }
+ rc = open(filename, flags, 0600);
if (rc >= 0 && realname)
strcpy(realname, filename);
return rc;