]> code.delx.au - gnu-emacs/blobdiff - src/cygw32.c
Rework C source files to avoid ^(
[gnu-emacs] / src / cygw32.c
index a7dbdaed6150292d044cef04ad373722dffcadf3..682232035f64463d21196110765fd77887e622a9 100644 (file)
@@ -1,12 +1,12 @@
 /* Cygwin support routines.
-   Copyright (C) 2011-2013 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -23,24 +23,23 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <unistd.h>
 #include <fcntl.h>
 
-static Lisp_Object
-fchdir_unwind (Lisp_Object dir_fd)
+static void
+fchdir_unwind (int dir_fd)
 {
-  (void) fchdir (XFASTINT (dir_fd));
-  (void) close (XFASTINT (dir_fd));
-  return Qnil;
+  (void) fchdir (dir_fd);
+  (void) close (dir_fd);
 }
 
 static void
 chdir_to_default_directory ()
 {
   Lisp_Object new_cwd;
-  int old_cwd_fd = open (".", O_RDONLY | O_DIRECTORY);
+  int old_cwd_fd = emacs_open (".", O_RDONLY | O_DIRECTORY, 0);
 
   if (old_cwd_fd == -1)
     error ("could not open current directory: %s", strerror (errno));
 
-  record_unwind_protect (fchdir_unwind, make_number (old_cwd_fd));
+  record_unwind_protect_int (fchdir_unwind, old_cwd_fd);
 
   new_cwd = Funhandled_file_name_directory (
     Fexpand_file_name (build_string ("."), Qnil));