X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/5580185eb67c5fdc3b2c418c3a24550ed5f96bd8..48d8155d318eeecd6b290db87d96f41687759ab2:/gdb/gdb.c diff --git a/gdb/gdb.c b/gdb/gdb.c index d53e8faf..fd6cce42 100644 --- a/gdb/gdb.c +++ b/gdb/gdb.c @@ -28,18 +28,25 @@ static char *rcsid_gdb_c = "$Header$"; /************************************************************************/ #include -#include +#include #include #include #include "gdb.h" #include "gdb_lib.h" #include +#ifdef POSIX +#include +#endif extern int sys_nerr; extern char *sys_errlist[]; extern int errno; +/* This global is defined to make sure that Moira clients are linked + * against the correct library. + */ +int link_against_the_moira_version_of_gdb = 0; int g_inited = FALSE; /* gdb_init has not been */ /* called */ @@ -61,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 */ @@ -92,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(hostname)+1); - (void) strcpy(gdb_uname, uname); + username = "????"; + gdb_uname = db_alloc(strlen(username)+1); + (void) strcpy(gdb_uname, username); return 0; }