mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
avoid unix special files
This commit is contained in:
parent
8a75090664
commit
5fc55a953e
1 changed files with 7 additions and 14 deletions
|
@ -382,18 +382,6 @@ isexcluded(char *name)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
islink(char *name)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if(lstat(name, &st) < 0)
|
||||
return 0;
|
||||
if((st.st_mode&S_IFMT) == S_IFLNK)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
vacfile(DirSink *dsink, char *lname, char *sname, VacFile *vf)
|
||||
{
|
||||
|
@ -410,9 +398,14 @@ vacfile(DirSink *dsink, char *lname, char *sname, VacFile *vf)
|
|||
if(merge && vacmerge(dsink, lname, sname) >= 0)
|
||||
return;
|
||||
|
||||
if(islink(sname))
|
||||
if((dir = dirstat(sname)) == nil){
|
||||
warn("could not stat file %s: %r", lname);
|
||||
if(dir->mode&(DMSYMLINK|DMDEVICE|DMNAMEDPIPE|DMSOCKET)){
|
||||
free(dir);
|
||||
return;
|
||||
|
||||
}
|
||||
free(dir);
|
||||
|
||||
fd = open(sname, OREAD);
|
||||
if(fd < 0) {
|
||||
warn("could not open file: %s: %r", lname);
|
||||
|
|
Loading…
Reference in a new issue