Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 825565 Details for
Bug 1031568
[abrt] initscripts-9.49.11-1.el7: getc: Process /usr/lib/udev/udev-kvm-check was killed by signal 11 (SIGSEGV)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch
0001-udev-kvm-check-simplify-reading-of-threshold.patch (text/plain), 3.68 KB, created by
Lukáš Nykrýn
on 2013-11-18 11:54:24 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Lukáš Nykrýn
Created:
2013-11-18 11:54:24 UTC
Size:
3.68 KB
patch
obsolete
>From befa38a3a79feffb320e24e7e179ae42ed569914 Mon Sep 17 00:00:00 2001 >From: Lukas Nykryn <lnykryn@redhat.com> >Date: Mon, 18 Nov 2013 12:27:22 +0100 >Subject: [PATCH] udev-kvm-check: simplify reading of threshold > >--- > src/Makefile | 8 +++-- > src/udev-kvm-check.c | 91 ++++++++++------------------------------------------ > 2 files changed, 23 insertions(+), 76 deletions(-) > >diff --git a/src/Makefile b/src/Makefile >index f284215..e126569 100644 >--- a/src/Makefile >+++ b/src/Makefile >@@ -7,6 +7,7 @@ PPPWATCH_OBJS=ppp-watch.o shvar.o > BRANDBOT_OBJS=brandbot.o shvar.o > CONSOLE_INIT_OBJS=console_init.o shvar.o > USLEEP_OBJS=usleep.o >+UDEV_KVM_CHECK_OBJS=udev-kvm-check.o shvar.o > > mandir=/usr/share/man > >@@ -54,6 +55,9 @@ ppp-watch: $(PPPWATCH_OBJS) > brandbot: $(BRANDBOT_OBJS) > $(CC) $(LDFLAGS) -o $@ $(BRANDBOT_OBJS) `pkg-config glib-2.0 --libs` > >+udev-kvm-check: $(UDEV_KVM_CHECK_OBJS) >+ $(CC) $(LDFLAGS) -o $@ $(UDEV_KVM_CHECK_OBJS) `pkg-config glib-2.0 --libs` >+ > usernetctl.o: usernetctl.c > $(CC) $(CFLAGS) -fPIE -c usernetctl.c -o usernetctl.o > >@@ -78,6 +82,6 @@ ppp-watch.o: ppp-watch.c > rename_device: rename_device.c > $(CC) $(CFLAGS) `pkg-config glib-2.0 --cflags` -o $@ $< `pkg-config glib-2.0 --libs` > >-udev-kvm-check: udev-kvm-check.c >- $(CC) $(CFLAGS) -o $@ $< >+udev-kvm-check.o: udev-kvm-check.c >+ $(CC) $(CFLAGS) `pkg-config glib-2.0 --cflags` -c udev-kvm-check.c -o udev-kvm-check.o > >diff --git a/src/udev-kvm-check.c b/src/udev-kvm-check.c >index 43cb9d9..55595ee 100644 >--- a/src/udev-kvm-check.c >+++ b/src/udev-kvm-check.c >@@ -3,6 +3,7 @@ > #include <stdio.h> > #include <stdlib.h> > #include <string.h> >+#include "shvar.h" > > #define DEFAULT 0 > #define FACILITY "kvm" >@@ -19,85 +20,27 @@ > " may review the Red Hat Enterprise subscription" \ > " limits at http://www.redhat.com/rhel-virt-limits" > >-int get_threshold_from_file(FILE *fp) >+ >+int get_threshold() > { >- static const char key[] = "THRESHOLD="; >- int pos = 0; >- int thres; >- char ch; >- >-start: >- /* State START - at beginning of line, search for beginning of "THRESHOLD=" >- * string. >- */ >- ch = getc(fp); >- if (ch == EOF) { >- return DEFAULT; >- } >- if (isspace(ch)) { >- goto start; >- } >- if (ch == 'T') { >- pos = 1; >- goto key; >- } >- goto eol; >+ int val = 0; >+ char *cval = NULL; > >-eol: >- /* State EOL - loop until end of line */ >- ch = getc(fp); >- if (ch == EOF) { >- return DEFAULT; >- } >- if (ch == '\n') { >- goto start; >- } >- goto eol; >+ shvarFile *file = svNewFile(SYSCONFIG_KVM); >+ if (!file) >+ return 0; > >-key: >- /* State KEY - match "THRESHOLD=" string, go to THRESHOLD if found */ >- ch = getc(fp); >- if (ch == EOF) { >- return DEFAULT; >- } >- if (ch == key[pos]) { >- pos++; >- if (key[pos] == 0) { >- goto threshold; >- } else { >- goto key; >- } >- } >- goto eol; >- >-threshold: >- /* State THRESHOLD - parse number using fscanf, expect comment or space >- * or EOL. >- */ >- ch = getc(fp); >- if (ch == EOF) { >- return DEFAULT; >- } >- if (!isdigit(ch)) { >- goto eol; >- } >- ungetc(ch, fp); >- if (fscanf(fp, "%d", &thres) != 1) { >- return DEFAULT; >- } >- ch = getc(fp); >- if (ch == '#' || ch == EOF || ch == '\n' || isspace(ch)) { >- return thres; >- } >- goto eol; >-} >+ cval = svGetValue(file, "THRESHOLD"); > >-int get_threshold() >-{ >- FILE *fp = fopen(SYSCONFIG_KVM, "r"); >- int val = get_threshold_from_file(fp); >+ svCloseFile(file); >+ >+ if (cval == NULL) >+ return 0; >+ >+ val = atoi(cval); > >- fclose (fp); >+ free(cval); >+ > return val; > } > >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1031568
:
825479
|
825480
|
825481
|
825482
|
825483
|
825484
|
825485
|
825486
|
825487
|
825488
|
825489
| 825565