Subversion Repositories wimsdev

Rev

Rev 12248 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12248 Rev 13431
Line 89... Line 89...
89
  sdir=opendir(dirname);
89
  sdir=opendir(dirname);
90
  if(sdir==NULL) {   /* Cannot open session directory. */
90
  if(sdir==NULL) {   /* Cannot open session directory. */
91
     return -1;
91
     return -1;
92
  }
92
  }
93
  while((f=readdir(sdir))!=NULL) {
93
  while((f=readdir(sdir))!=NULL) {
94
    char fname[255];
94
    char fname[257];
95
    if(strcmp(".",f->d_name)==0 || strcmp("..",f->d_name)==0) continue;
95
    if(strcmp(".",f->d_name)==0 || strcmp("..",f->d_name)==0) continue;
96
    snprintf(fname,sizeof(fname),"%s/%s",dirname,f->d_name);
96
    snprintf(fname,sizeof(fname),"%s/%s",dirname,f->d_name);
97
    if(lstat(fname,&dst)) continue;
97
    if(lstat(fname,&dst)) continue;
98
    if(S_ISDIR(dst.st_mode)) remove_tree(fname);
98
    if(S_ISDIR(dst.st_mode)) remove_tree(fname);
99
    else {
99
    else {
Line 135... Line 135...
135
{
135
{
136
  DIR *sdir_base;
136
  DIR *sdir_base;
137
  struct dirent *ses;
137
  struct dirent *ses;
138
  struct stat dst;
138
  struct stat dst;
139
  struct utimbuf ub;
139
  struct utimbuf ub;
140
  char dbuf[256];
140
  char dbuf[262];
141
 
141
 
142
  if(stat(timestamp,&dst)==0 && dst.st_mtime==now) return;
142
  if(stat(timestamp,&dst)==0 && dst.st_mtime==now) return;
143
  ub.actime=ub.modtime=now; utime(timestamp,&ub);
143
  ub.actime=ub.modtime=now; utime(timestamp,&ub);
144
  sdir_base=opendir("/proc");
144
  sdir_base=opendir("/proc");
145
  if(sdir_base==NULL) goto tmpdir;
145
  if(sdir_base==NULL) goto tmpdir;