Tue Oct 7 23:23:43 2008 UTC ()
check rump_init() return value


(pooka)
diff -r1.4 -r1.5 src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c

cvs diff -r1.4 -r1.5 src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c (expand / switch to unified diff)

--- src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c 2008/09/02 19:38:25 1.4
+++ src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c 2008/10/07 23:23:43 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rump_syspuffs.c,v 1.4 2008/09/02 19:38:25 pooka Exp $ */ 1/* $NetBSD: rump_syspuffs.c,v 1.5 2008/10/07 23:23:43 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Development of this software was supported by the 6 * Development of this software was supported by the
7 * Research Foundation of Helsinki University of Technology 7 * Research Foundation of Helsinki University of Technology
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -92,27 +92,28 @@ mount_syspuffs_parseargs(int argc, char  @@ -92,27 +92,28 @@ mount_syspuffs_parseargs(int argc, char
92 int *pflags = &args->us_pflags; 92 int *pflags = &args->us_pflags;
93 char comfd[16]; 93 char comfd[16];
94 int sv[2]; 94 int sv[2];
95 size_t len; 95 size_t len;
96 int rv; 96 int rv;
97 97
98 if (argc < 2) 98 if (argc < 2)
99 usage(); 99 usage();
100 100
101 /* Create sucketpair for communication with the real file server */ 101 /* Create sucketpair for communication with the real file server */
102 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, sv) == -1) 102 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, sv) == -1)
103 err(1, "socketpair"); 103 err(1, "socketpair");
104 104
105 rump_init(); 105 if ((rv = rump_init()) == -1)
 106 err(1, "rump_init");
106 107
107 switch (fork()) { 108 switch (fork()) {
108 case 0: 109 case 0:
109 close(sv[1]); 110 close(sv[1]);
110 snprintf(comfd, sizeof(sv[0]), "%d", sv[0]); 111 snprintf(comfd, sizeof(sv[0]), "%d", sv[0]);
111 if (setenv("PUFFS_COMFD", comfd, 1) == -1) 112 if (setenv("PUFFS_COMFD", comfd, 1) == -1)
112 err(1, "setenv"); 113 err(1, "setenv");
113 114
114 argv++; 115 argv++;
115 if (execvp(argv[0], argv) == -1) 116 if (execvp(argv[0], argv) == -1)
116 err(1, "execvp"); 117 err(1, "execvp");
117 /*NOTREACHED*/ 118 /*NOTREACHED*/
118 case -1: 119 case -1: