Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.6:Update
s390-tools.30305
s390-tools-sles15sp5-01-zdev-add-proper-value-i...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File s390-tools-sles15sp5-01-zdev-add-proper-value-input-for-the-ZDEV_SITE_ID-key.patch of Package s390-tools.30305
--- zdev/src/zdev_id.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) --- a/zdev/src/zdev_id.c +++ b/zdev/src/zdev_id.c @@ -213,16 +213,28 @@ out: static void write_zdev_site_id(int site_id) { FILE *fd; + int rc; fd = fopen(ZDEV_SITE_ID_FILE, "w"); if (!fd) - err(1, "Could not write to zdev_site_id file"); + goto err; + if (site_id == SITE_FALLBACK) - fprintf(fd, "ZDEV_SITE_ID=\n"); + rc = fprintf(fd, "ZDEV_SITE_ID=\"\"\n"); else - fprintf(fd, "ZDEV_SITE_ID=%d\n", site_id); + rc = fprintf(fd, "ZDEV_SITE_ID=%d\n", site_id); - fclose(fd); + if (rc < 0) { + fclose(fd); + goto err; + } + + if (fclose(fd)) + goto err; + + return; +err: + err(1, "Could not write to zdev_site_id file"); } /* Read the loadparm and extract the current site_id. @@ -265,7 +277,7 @@ static void process_loadparm(const char out: write_zdev_site_id(site_id); if (site_id == SITE_FALLBACK) - printf("ZDEV_SITE_ID=\n"); + printf("ZDEV_SITE_ID=\"\"\n"); else printf("ZDEV_SITE_ID=%d\n", site_id); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor