summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 82d3396)
raw | patch | inline | side by side (parent: 82d3396)
author | Thomas Vander Stichele <thomas@apestaart.org> | |
Fri, 16 Apr 2004 10:17:55 +0000 (10:17 +0000) | ||
committer | Thomas Vander Stichele <thomas@apestaart.org> | |
Fri, 16 Apr 2004 10:17:55 +0000 (10:17 +0000) |
Original commit message from CVS:
do error checking instead of segfaulting
do error checking instead of segfaulting
ChangeLog | patch | blob | history | |
tests/old/testsuite/refcounting/mem.c | patch | blob | history | |
testsuite/refcounting/mem.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 44186f59085834f780bd15760b6eb3da93233fa1..696410e1d499ea3dd8abafb87783e15f5e945030 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2004-04-16 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * testsuite/refcounting/mem.c: (vmsize):
+ do error checking
+
2004-04-16 Johan Dahlin <johan@gnome.org>
* docs/gst/gstreamer-sections.txt: Add gst_pad_call_chain_function
index 433918a4e4e8cac4a168a92346c33671cf2826fb..5911dc61dec70ce745a7b65c58b8ec5f3a10b032 100644 (file)
pid = getpid ();
snprintf (filename, 17, "/proc/%d/stat", pid);
fd = open (filename, O_RDONLY);
+ if (fd == -1) {
+ fprintf (stderr, "warning: could not open %s\n", filename);
+ return -1;
+ }
size = read (fd, buf, 240);
+ if (size == -1)
+ return -1;
ptr = buf;
for (i = 0; i < 22; i++)
ptr = (char *) strchr (ptr, ' ') + 1;
index 433918a4e4e8cac4a168a92346c33671cf2826fb..5911dc61dec70ce745a7b65c58b8ec5f3a10b032 100644 (file)
pid = getpid ();
snprintf (filename, 17, "/proc/%d/stat", pid);
fd = open (filename, O_RDONLY);
+ if (fd == -1) {
+ fprintf (stderr, "warning: could not open %s\n", filename);
+ return -1;
+ }
size = read (fd, buf, 240);
+ if (size == -1)
+ return -1;
ptr = buf;
for (i = 0; i < 22; i++)
ptr = (char *) strchr (ptr, ' ') + 1;