X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/72f684f5a702ab6ffe99da5feaed6639b0fcad5e..45d92b30e4dd0ce58f3d365278d5c3410ea5e45f:/gdb/gdb.c diff --git a/gdb/gdb.c b/gdb/gdb.c index 3eeebf8c..03d10ee5 100644 --- a/gdb/gdb.c +++ b/gdb/gdb.c @@ -34,6 +34,9 @@ static char *rcsid_gdb_c = "$Header$"; #include "gdb.h" #include "gdb_lib.h" #include +#ifdef POSIX +#include +#endif extern int sys_nerr; extern char *sys_errlist[]; @@ -65,10 +68,18 @@ gdb_init() char hostname[255]; /* name of local host */ extern uid_t getuid(); int uid; /* Unix user-i.d. number */ - char *uname; /* string form of i.d. */ + char *username; /* string form of i.d. */ struct passwd *pw_struct; /* passwd entry comes back */ /* here */ +#ifdef POSIX + struct utsname nameposix; + struct sigaction act; + + sigemptyset(&act.sa_mask); + act.sa_flags = 0; +#endif + /* * So we know we've been initialized, and we do it only once */ @@ -96,11 +107,9 @@ gdb_init() */ gdb_mfd = 0; - for (i=0; ipw_name != NULL && *pw_struct->pw_name !='\0') - uname = pw_struct->pw_name; + username = pw_struct->pw_name; else - uname = "????"; - gdb_uname = db_alloc(strlen(uname)+1); - (void) strcpy(gdb_uname, uname); + username = "????"; + gdb_uname = db_alloc(strlen(username)+1); + (void) strcpy(gdb_uname, username); return 0; }