#if defined(_POSIX_VERSION)
#include <utime.h>
+#else
+struct utimbuf
+{
+ long actime;
+ long modtime;
+};
#endif
extern FILE *msg_file;
register char *data;
int fd, check, namelen, written, openflag;
long size;
- time_t acc_upd_times[2];
+ struct utimbuf acc_upd_times;
register int skipcrud;
register int i;
/* int sparse_ind = 0;*/
fd = 1;
goto extract_file;
}
- #ifdef O_CTG
+#ifdef O_CTG
/*
* Contiguous files (on the Masscomp) have to specify
* the size in the open call that creates them.
openflag | O_CTG,
hstat.st_mode, hstat.st_size);
else
- #endif
+#endif
{
- #ifdef NO_OPEN3
+#ifdef NO_OPEN3
/*
* On raw V7 we won't let them specify -k (f_keep), but
* we just bull ahead and create the files.
? longname
: head->header.name) + skipcrud,
hstat.st_mode);
- #else
+#else
/*
* With 3-arg open(), we can do this up right.
*/
fd = open(skipcrud + current_file_name,
openflag, hstat.st_mode);
- #endif
+#endif
}
if (fd < 0) {
if (!f_modified) {
/* fixme if f_gnudump should set ctime too, but how? */
if(f_gnudump)
- acc_upd_times[0]=hstat.st_atime;
- else acc_upd_times[0] = now; /* Accessed now */
- acc_upd_times[1] = hstat.st_mtime; /* Mod'd */
+ acc_upd_times.actime=hstat.st_atime;
+ else
+ acc_upd_times.actime = now; /* Accessed now */
+ acc_upd_times.modtime = hstat.st_mtime; /* Mod'd */
if (utime(skipcrud + current_file_name,
- acc_upd_times) < 0) {
+ &acc_upd_times) < 0) {
msg_perror("couldn't change access and modification times of %s",skipcrud + current_file_name);
}
}
/* Set back the utime and mode for all the extracted directories. */
void restore_saved_dir_info ()
{
- time_t acc_upd_times[2];
+ struct utimbuf acc_upd_times;
struct saved_dir_info *tmp;
while (saved_dir_info_head != NULL)
{
/* fixme if f_gnudump should set ctime too, but how? */
if(f_gnudump)
- acc_upd_times[0]=saved_dir_info_head -> atime;
- else acc_upd_times[0] = now; /* Accessed now */
- acc_upd_times[1] = saved_dir_info_head -> mtime; /* Mod'd */
- if (utime(saved_dir_info_head -> path, acc_upd_times) < 0) {
+ acc_upd_times.actime=saved_dir_info_head -> atime;
+ else
+ acc_upd_times.actime = now; /* Accessed now */
+ acc_upd_times.modtime = saved_dir_info_head -> mtime; /* Mod'd */
+ if (utime(saved_dir_info_head -> path, &acc_upd_times) < 0) {
msg_perror("couldn't change access and modification times of %s",
saved_dir_info_head -> path);
}