/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/plymouth.c

  • Committer: Teddy Hogeborn
  • Date: 2010-11-16 18:10:22 UTC
  • mfrom: (237.5.1 mandos-release)
  • Revision ID: teddy@fukt.bsnet.se-20101116181022-oz0dahg0q4jnyb0y
Merge from Björn

Show diffs side-by-side

added added

removed removed

Lines of Context:
198
198
      return 0;
199
199
    }
200
200
  }
201
 
  char exe_target[sizeof(plymouth_path)];
 
201
  char exe_target[sizeof(plymouthd_path)];
202
202
  char *exe_link;
203
203
  ret = asprintf(&exe_link, "/proc/%s/exe", proc_entry->d_name);
204
204
  if(ret == -1){
225
225
  
226
226
  ssize_t sret = readlink(exe_link, exe_target, sizeof(exe_target));
227
227
  free(exe_link);
228
 
  if((sret != (ssize_t)sizeof(plymouth_path)-1) or
229
 
      (memcmp(plymouth_path, exe_target,
230
 
              sizeof(plymouth_path)-1) != 0)){
 
228
  if((sret != (ssize_t)sizeof(plymouthd_path)-1) or
 
229
      (memcmp(plymouthd_path, exe_target,
 
230
              sizeof(plymouthd_path)-1) != 0)){
231
231
    return 0;
232
232
  }
233
233
  return 1;
247
247
  if(maxvalue == 0){
248
248
    struct dirent **direntries;
249
249
    ret = scandir("/proc", &direntries, is_plymouth, alphasort);
250
 
    sscanf(direntries[0]->d_name, "%" SCNuMAX, &maxvalue);
 
250
    if (ret == -1){
 
251
      error(0, errno, "scandir");
 
252
    }
 
253
    if (ret > 0){
 
254
      ret = sscanf(direntries[0]->d_name, "%" SCNuMAX, &maxvalue);
 
255
      if (ret < 0){
 
256
        error(0, errno, "sscanf");
 
257
      }
 
258
    }
251
259
  }
252
260
  pid_t pid;
253
261
  pid = (pid_t)maxvalue;