"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stress-efivar.c" between
stress-ng-0.12.09.tar.xz and stress-ng-0.12.10.tar.xz

About: stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.

stress-efivar.c  (stress-ng-0.12.09.tar.xz):stress-efivar.c  (stress-ng-0.12.10.tar.xz)
skipping to change at line 244 skipping to change at line 244
int fd, ret, rc = 0; int fd, ret, rc = 0;
size_t i; size_t i;
ssize_t n; ssize_t n;
char filename[PATH_MAX]; char filename[PATH_MAX];
static char data[4096]; static char data[4096];
struct stat statbuf; struct stat statbuf;
if ((!varname) || (!var)) if ((!varname) || (!var))
return -1; return -1;
if (efi_get_data(args, varname, "raw_var", var, sizeof(stress_efi_var_t)) < 0) if (efi_get_data(args, varname, "raw_var", var, sizeof(*var)) < 0)
rc = -1; rc = -1;
/* Exercise reading the efi sysfs files */ /* Exercise reading the efi sysfs files */
for (i = 0; i < SIZEOF_ARRAY(efi_sysfs_names); i++) { for (i = 0; i < SIZEOF_ARRAY(efi_sysfs_names); i++) {
(void)efi_get_data(args, varname, efi_sysfs_names[i], data, sizeo f(data)); (void)efi_get_data(args, varname, efi_sysfs_names[i], data, sizeo f(data));
} }
(void)stress_mk_filename(filename, sizeof(filename), efi_vars, varname); (void)stress_mk_filename(filename, sizeof(filename), efi_vars, varname);
if ((fd = open(filename, O_RDONLY)) < 0) if ((fd = open(filename, O_RDONLY)) < 0)
return -1; return -1;
skipping to change at line 383 skipping to change at line 383
pid_t pid; pid_t pid;
size_t sz; size_t sz;
efi_dentries = NULL; efi_dentries = NULL;
dir_count = scandir(vars, &efi_dentries, NULL, alphasort); dir_count = scandir(vars, &efi_dentries, NULL, alphasort);
if (!efi_dentries || (dir_count <= 0)) { if (!efi_dentries || (dir_count <= 0)) {
pr_inf("%s: cannot read EFI vars in %s\n", args->name, vars); pr_inf("%s: cannot read EFI vars in %s\n", args->name, vars);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
sz = (((size_t)dir_count * sizeof(bool)) + args->page_size) & (args->page _size - 1); sz = (((size_t)dir_count * sizeof(*efi_ignore)) + args->page_size) & (arg s->page_size - 1);
efi_ignore = mmap(NULL, sz, PROT_READ | PROT_WRITE, efi_ignore = mmap(NULL, sz, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_SHARED, -1, 0); MAP_ANONYMOUS | MAP_SHARED, -1, 0);
if (efi_ignore == MAP_FAILED) { if (efi_ignore == MAP_FAILED) {
pr_err("%s: cannot mmap shared memory: %d (%s))\n", pr_err("%s: cannot mmap shared memory: %d (%s))\n",
args->name, errno, strerror(errno)); args->name, errno, strerror(errno));
return EXIT_NO_RESOURCE; return EXIT_NO_RESOURCE;
} }
stress_set_proc_state(args->name, STRESS_STATE_RUN); stress_set_proc_state(args->name, STRESS_STATE_RUN);
again: again:
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)