aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-03-22 22:10:13 +0200
committerArnold D. Robbins <arnold@skeeve.com>2012-03-22 22:10:13 +0200
commitc7f51459f7da3e0c693f8a950726869d99e5bcf2 (patch)
tree2e4b54cc695adc5b4fdaec56e237250c030a5419 /main.c
parent1e495ca269aa2653bf804088ebe532b67110a3ef (diff)
parentb467a6d3d604723e0c152dceb09e998c059bfa40 (diff)
downloadegawk-c7f51459f7da3e0c693f8a950726869d99e5bcf2.tar.gz
egawk-c7f51459f7da3e0c693f8a950726869d99e5bcf2.tar.bz2
egawk-c7f51459f7da3e0c693f8a950726869d99e5bcf2.zip
Merge branch 'gawk-4.0-stable'
Diffstat (limited to 'main.c')
-rw-r--r--main.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/main.c b/main.c
index 8899db59..98f8739f 100644
--- a/main.c
+++ b/main.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2011 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-2012 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -24,7 +24,7 @@
*/
/* FIX THIS BEFORE EVERY RELEASE: */
-#define UPDATE_YEAR 2011
+#define UPDATE_YEAR 2012
#include "awk.h"
#include "getopt.h"
@@ -291,6 +291,8 @@ main(int argc, char **argv)
/* init array handling. */
array_init();
+ output_fp = stdout;
+
/* we do error messages ourselves on invalid options */
opterr = FALSE;
@@ -1371,17 +1373,20 @@ init_groupset()
*/
ngroups = getgroups(0, NULL);
#endif
- if (ngroups == -1)
- fatal(_("could not find groups: %s"), strerror(errno));
- else if (ngroups == 0)
+ /* If an error or no groups, just give up and get on with life. */
+ if (ngroups <= 0)
return;
/* fill in groups */
emalloc(groupset, GETGROUPS_T *, ngroups * sizeof(GETGROUPS_T), "init_groupset");
ngroups = getgroups(ngroups, groupset);
- if (ngroups == -1)
- fatal(_("could not find groups: %s"), strerror(errno));
+ /* same thing here, give up but keep going */
+ if (ngroups == -1) {
+ efree(groupset);
+ ngroups = 0;
+ groupset = NULL;
+ }
#endif
}