d = fdopendir (fd);
opendir_errno = errno;
if (! d)
- close (fd);
+ emacs_close (fd);
}
#endif
}
#ifdef WINDOWSNT
-Lisp_Object
+void
directory_files_internal_w32_unwind (Lisp_Object arg)
{
Vw32_get_true_file_attributes = arg;
- return Qnil;
}
#endif
-static Lisp_Object
-directory_files_internal_unwind (Lisp_Object dh)
+static void
+directory_files_internal_unwind (void *dh)
{
- DIR *d = XSAVE_POINTER (dh, 0);
+ DIR *d = dh;
block_input ();
closedir (d);
unblock_input ();
- return Qnil;
}
/* Function shared by Fdirectory_files and Fdirectory_files_and_attributes.
d = open_directory (SSDATA (dirfilename), &fd);
if (d == NULL)
- report_file_error ("Opening directory", Fcons (directory, Qnil));
+ report_file_error ("Opening directory", directory);
/* Unfortunately, we can now invoke expand-file-name and
file-attributes on filenames, both of which can throw, so we must
do a proper unwind-protect. */
- record_unwind_protect (directory_files_internal_unwind,
- make_save_pointer (d));
+ record_unwind_protect_ptr (directory_files_internal_unwind, d);
#ifdef WINDOWSNT
if (attrs)
memcpy (SDATA (fullname) + directory_nbytes + needsep,
SDATA (name), len);
- nchars = chars_in_text (SDATA (fullname), nbytes);
+ nchars = multibyte_chars_in_text (SDATA (fullname), nbytes);
/* Some bug somewhere. */
if (nchars > nbytes)
d = open_directory (SSDATA (encoded_dir), &fd);
if (!d)
- report_file_error ("Opening directory", Fcons (dirname, Qnil));
+ report_file_error ("Opening directory", dirname);
- record_unwind_protect (directory_files_internal_unwind,
- make_save_pointer (d));
+ record_unwind_protect_ptr (directory_files_internal_unwind, d);
/* Loop reading blocks */
/* (att3b compiler bug requires do a null comparison this way) */
QUIT;
if (len < SCHARS (encoded_file)
- || scmp (dp->d_name, SSDATA (encoded_file),
- SCHARS (encoded_file)) >= 0)
+ || (scmp (dp->d_name, SSDATA (encoded_file),
+ SCHARS (encoded_file))
+ >= 0))
continue;
if (file_name_completion_stat (fd, dp, &st) < 0)
#endif
if (EQ (users, Qnil))
/* At least current user is always known. */
- users = Fcons (Vuser_real_login_name, Qnil);
+ users = list1 (Vuser_real_login_name);
return users;
}