]> Dogcows Code - chaz/tar/blobdiff - src/extract.c
tar: don't crash if getcwd fails
[chaz/tar] / src / extract.c
index 7ce9ce863f188f3c8babb83e3eb829d05ab83820..9897e82a61bd1d18c4c90743f236477516205ae0 100644 (file)
@@ -23,7 +23,6 @@
 #include <quotearg.h>
 #include <utimens.h>
 #include <errno.h>
-#include <xgetcwd.h>
 #include <priv-set.h>
 
 #include "common.h"
@@ -648,13 +647,11 @@ extract_dir (char *file_name, int typeflag)
   if (one_file_system_option && root_device == 0)
     {
       struct stat st;
-      char *dir = xgetcwd ();
 
-      if (deref_stat (true, dir, &st))
-       stat_diag (dir);
+      if (stat (".", &st) != 0)
+       stat_diag (".");
       else
        root_device = st.st_dev;
-      free (dir);
     }
 
   if (incremental_option)
This page took 0.019977 seconds and 4 git commands to generate.