diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-03-22 22:10:13 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-03-22 22:10:13 +0200 |
commit | c7f51459f7da3e0c693f8a950726869d99e5bcf2 (patch) | |
tree | 2e4b54cc695adc5b4fdaec56e237250c030a5419 /main.c | |
parent | 1e495ca269aa2653bf804088ebe532b67110a3ef (diff) | |
parent | b467a6d3d604723e0c152dceb09e998c059bfa40 (diff) | |
download | egawk-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.c | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -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 } |