X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsave-cwd.c;h=f07973a3ab3fafe2df657c5c526c44922861a324;hb=cbb4401a52ac870ccfe0fbc1e1503e4741ca8fd5;hp=4ff600e58a85fb48567ae10a14547c6386a3e85c;hpb=7c3f8da8f075e3813ced160d5b53a28c6f7dfe78;p=gnulib.git diff --git a/lib/save-cwd.c b/lib/save-cwd.c index 4ff600e58..f07973a3a 100644 --- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -1,7 +1,7 @@ /* save-cwd.c -- Save and restore current working directory. - Copyright (C) 1995, 1997, 1998, 2003, 2004, 2005 Free Software - Foundation, Inc. + Copyright (C) 1995, 1997, 1998, 2003, 2004, 2005, 2006 Free + Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,9 +19,7 @@ /* Written by Jim Meyering. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include "save-cwd.h" @@ -75,12 +73,8 @@ save_cwd (struct saved_cwd *cwd) cwd->desc = open (".", O_RDONLY); if (cwd->desc < 0) { - cwd->desc = open (".", O_WRONLY); - if (cwd->desc < 0) - { - cwd->name = xgetcwd (); - return cwd->name ? 0 : -1; - } + cwd->name = xgetcwd (); + return cwd->name ? 0 : -1; } return 0;