#else
# define dirent direct
# define NLENGTH(direct) ((size_t) (direct)->d_namlen)
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif
-
-#if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H
-# define HAVE_DIR 1
-#else
-# define HAVE_DIR 0
+# include <ndir.h>
#endif
#if D_INO_IN_DIRENT
}
}
-#if HAVE_DIR
-
/* Returned values for NUMBERED_BACKUP. */
enum numbered_backup_result
*buffer = buf;
return result;
}
-#endif /* HAVE_DIR */
/* Return the name of the new backup file for the existing file FILE,
allocated with malloc. Report an error and fail if out of memory.
size_t simple_backup_suffix_size = strlen (simple_backup_suffix) + 1;
size_t backup_suffix_size_guess = simple_backup_suffix_size;
enum { GUESS = sizeof ".~12345~" };
- if (HAVE_DIR && backup_suffix_size_guess < GUESS)
+ if (backup_suffix_size_guess < GUESS)
backup_suffix_size_guess = GUESS;
ssize = filelen + backup_suffix_size_guess + 1;
s = xmalloc (ssize);
memcpy (s, file, filelen + 1);
-#if HAVE_DIR
if (backup_type != simple_backups)
switch (numbered_backup (&s, ssize, filelen))
{
simple = (backup_type == numbered_existing_backups);
break;
}
-#endif
if (simple)
memcpy (s + filelen, simple_backup_suffix, simple_backup_suffix_size);