Skip to content
Snippets Groups Projects
Commit 25b1c058 authored by Morris Jette's avatar Morris Jette
Browse files

Corrections to recent cgroup patches

One new file was not packaged in the RPM and compiler reported that one
variable could be used without being initialized and another variable
was never used.
parent 3ff4eb9b
No related branches found
No related tags found
No related merge requests found
......@@ -419,6 +419,7 @@ DESTDIR="$RPM_BUILD_ROOT" make install-contrib
%endif
install -D -m644 etc/slurm.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/slurm.conf.example
install -D -m644 etc/cgroup.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/cgroup.conf.example
install -D -m755 etc/cgroup_allowed_devices_file.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/cgroup_allowed_devices_file.conf.example
install -D -m755 etc/cgroup.release_common.example ${RPM_BUILD_ROOT}%{_sysconfdir}/cgroup.release_common.example
install -D -m755 etc/cgroup.release_common.example ${RPM_BUILD_ROOT}%{_sysconfdir}/cgroup/release_freezer
install -D -m755 etc/cgroup.release_common.example ${RPM_BUILD_ROOT}%{_sysconfdir}/cgroup/release_cpuset
......@@ -587,6 +588,7 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_libdir}/slurm/src
%config %{_sysconfdir}/slurm.conf.example
%config %{_sysconfdir}/cgroup.conf.example
%config %{_sysconfdir}/cgroup_allowed_devices_file.conf.example
%config %{_sysconfdir}/cgroup.release_common.example
%config (noreplace) %{_sysconfdir}/cgroup/release_freezer
%config (noreplace) %{_sysconfdir}/cgroup/release_cpuset
......
......@@ -467,15 +467,14 @@ static int read_allowed_devices_file(char **allowed_devices)
{
FILE *file = fopen (cgroup_allowed_devices_file, "r" );
int i, j, l, num_lines;
int i, l, num_lines = 0;
char line[256];
glob_t globbuf;
for( i=0; i<256; i++ )
line[i] = '\0';
if ( file != NULL ){
num_lines=0;
if ( file != NULL ){
while ( fgets ( line, sizeof line, file ) != NULL ){
line[strlen(line)-1] = '\0';
......@@ -484,7 +483,7 @@ static int read_allowed_devices_file(char **allowed_devices)
debug3("Device %s does not exist", line);
}else{
for(l=0; l < globbuf.gl_pathc; l++){
allowed_devices[num_lines] =
allowed_devices[num_lines] =
xstrdup(globbuf.gl_pathv[l]);
num_lines++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment