- Copyright (C) 1988, 92, 93, 94, 96, 97 Free Software Foundation, Inc.
+ Copyright (C) 1988, 92,93,94,96,97,98, 1999 Free Software Foundation, Inc.
Written by John Gilmore, on 1985-11-19.
This program is free software; you can redistribute it and/or modify it
Written by John Gilmore, on 1985-11-19.
This program is free software; you can redistribute it and/or modify it
/* On a few systems, and in particular, those allowing to give files
away, changing the owner or group destroys the suid or sgid bits.
/* On a few systems, and in particular, those allowing to give files
away, changing the owner or group destroys the suid or sgid bits.
{
/* JK - What we want to do if the file is sparse is loop through
the array of sparse structures in the header and read in and
{
/* JK - What we want to do if the file is sparse is loop through
the array of sparse structures in the header and read in and
- /* Read in the list of extended headers and translate them into
- the sparsearray as before. */
+ /* Read in the list of extended headers and translate them
+ into the sparsearray as before. Note that this
+ invalidates current_header. */
openflag = (keep_old_files_option ?
O_BINARY | O_NDELAY | O_WRONLY | O_CREAT | O_EXCL :
O_BINARY | O_NDELAY | O_WRONLY | O_CREAT | O_TRUNC)
openflag = (keep_old_files_option ?
O_BINARY | O_NDELAY | O_WRONLY | O_CREAT | O_EXCL :
O_BINARY | O_NDELAY | O_WRONLY | O_CREAT | O_TRUNC)
/* JK - The last | is a kludge to solve the problem the O_APPEND
flag causes with files we are trying to make sparse: when a file
/* JK - The last | is a kludge to solve the problem the O_APPEND
flag causes with files we are trying to make sparse: when a file
/* Contiguous files (on the Masscomp) have to specify the size in
the open call that creates them. */
/* Contiguous files (on the Masscomp) have to specify the size in
the open call that creates them. */
fd = open (CURRENT_FILE_NAME, openflag | O_CTG,
current_stat.st_mode, current_stat.st_size);
else
fd = open (CURRENT_FILE_NAME, openflag, current_stat.st_mode);
#else /* not O_CTG */
fd = open (CURRENT_FILE_NAME, openflag | O_CTG,
current_stat.st_mode, current_stat.st_size);
else
fd = open (CURRENT_FILE_NAME, openflag, current_stat.st_mode);
#else /* not O_CTG */
{
lseek (fd, sparsearray[sparse_ind].offset, 0);
written = sparsearray[sparse_ind++].numbytes;
{
lseek (fd, sparsearray[sparse_ind].offset, 0);
written = sparsearray[sparse_ind++].numbytes;