summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.ypupdated/yp_dbdelete.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1997-05-28 15:47:10 +0000
committerwpaul <wpaul@FreeBSD.org>1997-05-28 15:47:10 +0000
commit93c9d6f0d2e00568c4a86fdce41d2843a35dcb29 (patch)
tree2cec6e499fc9885ffaaca37c53d046064f0d2ecf /usr.sbin/rpc.ypupdated/yp_dbdelete.c
parent7467e74fd1ffc0466987fdf1610da369c4f873e3 (diff)
parent90bef9e0aea2a3b97f16d0f3d3a23b6df8221e96 (diff)
downloadFreeBSD-src-93c9d6f0d2e00568c4a86fdce41d2843a35dcb29.zip
FreeBSD-src-93c9d6f0d2e00568c4a86fdce41d2843a35dcb29.tar.gz
This commit was generated by cvs2svn to compensate for changes in r26236,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'usr.sbin/rpc.ypupdated/yp_dbdelete.c')
-rw-r--r--usr.sbin/rpc.ypupdated/yp_dbdelete.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/usr.sbin/rpc.ypupdated/yp_dbdelete.c b/usr.sbin/rpc.ypupdated/yp_dbdelete.c
new file mode 100644
index 0000000..622b445
--- /dev/null
+++ b/usr.sbin/rpc.ypupdated/yp_dbdelete.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 1995, 1996
+ * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Bill Paul.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id: yp_dbdelete.c,v 1.1 1996/12/26 05:43:03 wpaul Exp wpaul $
+ *
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <string.h>
+#include <limits.h>
+#include <unistd.h>
+#include <db.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <paths.h>
+#include <rpcsvc/yp.h>
+#include "ypxfr_extern.h"
+
+#ifndef lint
+static const char rcsid[] = "$Id: yp_dbdelete.c,v 1.1 1996/12/26 05:43:03 wpaul Exp wpaul $";
+#endif
+
+int yp_del_record(dbp,key)
+ DB *dbp;
+ DBT *key;
+{
+ int rval;
+
+ if ((rval = (dbp->del)(dbp,key,0))) {
+ switch(rval) {
+ case 1:
+ return(YP_FALSE);
+ break;
+ case -1:
+ default:
+ (void)(dbp->close)(dbp);
+ return(YP_BADDB);
+ break;
+ }
+ }
+
+ return(YP_TRUE);
+}
OpenPOWER on IntegriCloud