yp_dbupdate.c (79452) | yp_dbupdate.c (90297) |
---|---|
1/* 2 * Copyright (c) 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#ifndef lint 34static const char rcsid[] = | 1/* 2 * Copyright (c) 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#ifndef lint 34static const char rcsid[] = |
35 "$FreeBSD: head/usr.sbin/rpc.ypupdated/yp_dbupdate.c 79452 2001-07-09 09:24:06Z brian $"; | 35 "$FreeBSD: head/usr.sbin/rpc.ypupdated/yp_dbupdate.c 90297 2002-02-06 13:30:31Z des $"; |
36#endif /* not lint */ 37 38#include <sys/fcntl.h> 39 40#include <stdio.h> 41#include <string.h> 42#include <errno.h> 43#include <limits.h> --- 6 unchanged lines hidden (view full) --- 50#include "ypupdated_extern.h" 51 52static int yp_domake(map, domain) 53 char *map; 54 char *domain; 55{ 56 int pid; 57 | 36#endif /* not lint */ 37 38#include <sys/fcntl.h> 39 40#include <stdio.h> 41#include <string.h> 42#include <errno.h> 43#include <limits.h> --- 6 unchanged lines hidden (view full) --- 50#include "ypupdated_extern.h" 51 52static int yp_domake(map, domain) 53 char *map; 54 char *domain; 55{ 56 int pid; 57 |
58 switch((pid = fork())) { | 58 switch ((pid = fork())) { |
59 case 0: 60 execlp(MAP_UPDATE_PATH, MAP_UPDATE, map, domain, (char *)NULL); 61 yp_error("couldn't exec map update process: %s", 62 strerror(errno)); 63 exit(1); 64 break; 65 case -1: 66 yp_error("fork() failed: %s", strerror(errno)); --- 32 unchanged lines hidden (view full) --- 99 if (dbp == NULL) 100 return(ERR_DBASE); 101 102 key.data = keyval; 103 key.size = keylen; 104 data.data = datval; 105 data.size = datlen; 106 | 59 case 0: 60 execlp(MAP_UPDATE_PATH, MAP_UPDATE, map, domain, (char *)NULL); 61 yp_error("couldn't exec map update process: %s", 62 strerror(errno)); 63 exit(1); 64 break; 65 case -1: 66 yp_error("fork() failed: %s", strerror(errno)); --- 32 unchanged lines hidden (view full) --- 99 if (dbp == NULL) 100 return(ERR_DBASE); 101 102 key.data = keyval; 103 key.size = keylen; 104 data.data = datval; 105 data.size = datlen; 106 |
107 switch(op) { | 107 switch (op) { |
108 case YPOP_DELETE: /* delete this entry */ 109 rval = yp_del_record(dbp, &key); 110 if (rval == YP_TRUE) 111 rval = 0; 112 break; 113 case YPOP_INSERT: /* add, do not change */ 114 rval = yp_put_record(dbp, &key, &data, 0); 115 if (rval == YP_TRUE) --- 39 unchanged lines hidden --- | 108 case YPOP_DELETE: /* delete this entry */ 109 rval = yp_del_record(dbp, &key); 110 if (rval == YP_TRUE) 111 rval = 0; 112 break; 113 case YPOP_INSERT: /* add, do not change */ 114 rval = yp_put_record(dbp, &key, &data, 0); 115 if (rval == YP_TRUE) --- 39 unchanged lines hidden --- |