(dwarfout_init): Report failure of getpwd.

From-SVN: r4930
This commit is contained in:
Richard Stallman 1993-07-17 01:34:14 +00:00
parent 42cd476bc3
commit 82e9f5e9b2
1 changed files with 9 additions and 3 deletions

View File

@ -5383,9 +5383,15 @@ dwarfout_init (asm_out_file, main_input_filename)
ASM_OUTPUT_PUSH_SECTION (asm_out_file, SFNAMES_SECTION);
ASM_OUTPUT_LABEL (asm_out_file, SFNAMES_BEGIN_LABEL);
{
register char *pwd = getpwd ();
register unsigned len = strlen (pwd);
register char *dirname = (char *) xmalloc (len + 2);
register char *pwd;
register unsigned len;
register char *dirname;
pwd = getpwd ();
if (!pwd)
pfatal_with_name ("getpwd");
len = strlen (pwd);
dirname = (char *) xmalloc (len + 2);
strcpy (dirname, pwd);
strcpy (dirname + len, "/");