Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/gpt CID 1341548: Check error returns



details:   https://anonhg.NetBSD.org/src/rev/97f94d7fd734
branches:  trunk
changeset: 342039:97f94d7fd734
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Dec 03 20:58:08 2015 +0000

description:
CID 1341548: Check error returns

diffstat:

 sbin/gpt/add.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 0b49fa65ae86 -r 97f94d7fd734 sbin/gpt/add.c
--- a/sbin/gpt/add.c    Thu Dec 03 20:01:19 2015 +0000
+++ b/sbin/gpt/add.c    Thu Dec 03 20:58:08 2015 +0000
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: add.c,v 1.39 2015/12/03 02:02:43 christos Exp $");
+__RCSID("$NetBSD: add.c,v 1.40 2015/12/03 20:58:08 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -139,11 +139,13 @@
        }
 
        ent_set(ent, map, type, name);
-       gpt_write_primary(gpt);
+       if (gpt_write_primary(gpt) == -1)
+               return -1;
 
        ent = gpt_ent_backup(gpt, i);
        ent_set(ent, map, type, name);
-       gpt_write_backup(gpt);
+       if (gpt_write_backup(gpt) == -1)
+               return -1;
 
        gpt_uuid_snprintf(buf, sizeof(buf), "%d", type);
        gpt_msg(gpt, "Partition %d added: %s %" PRIu64 " %" PRIu64, i + 1,



Home | Main Index | Thread Index | Old Index