Module Name: othersrc Committed By: lukem Date: Tue Jan 29 07:57:17 UTC 2019
Modified Files: othersrc/libexec/tnftpd/libnetbsd: strmode.c Log Message: sync to NetBSD strmode.c 1.19 Update from NetBSD src/lib/libc/string/strmode.c 1.11 to 1.19: - Minimize changes from upstream NetBSD source. - 1.14: Conditionally support S_IFDOOR. - 1.15: Move UCB-licensed code from 4-clause to 3-clause licence. [already done] - 1.16: Conditionally support S_IFSOCK. - 1.19: ANSI definitions. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/libnetbsd/strmode.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: othersrc/libexec/tnftpd/libnetbsd/strmode.c diff -u othersrc/libexec/tnftpd/libnetbsd/strmode.c:1.3 othersrc/libexec/tnftpd/libnetbsd/strmode.c:1.4 --- othersrc/libexec/tnftpd/libnetbsd/strmode.c:1.3 Sun Sep 21 16:35:25 2008 +++ othersrc/libexec/tnftpd/libnetbsd/strmode.c Tue Jan 29 07:57:17 2019 @@ -1,5 +1,5 @@ -/* $NetBSD: strmode.c,v 1.3 2008/09/21 16:35:25 lukem Exp $ */ -/* from NetBSD: strmode.c,v 1.11 1999/09/20 04:39:47 lukem Exp */ +/* $NetBSD: strmode.c,v 1.4 2019/01/29 07:57:17 lukem Exp $ */ +/* from NetBSD: strmode.c,v 1.19 2012/06/25 22:32:46 abs Exp */ /*- * Copyright (c) 1990, 1993 @@ -32,12 +32,37 @@ #include "tnftpd.h" +#if 0 + +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +#include <sys/cdefs.h> +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94"; +#else +__RCSID("$NetBSD: strmode.c,v 1.4 2019/01/29 07:57:17 lukem Exp $"); +#endif +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" +#include <sys/types.h> +#include <sys/stat.h> + +#include <assert.h> +#include <unistd.h> + +#endif + +#if !HAVE_STRMODE void -strmode(mode, p) - mode_t mode; - char *p; +strmode(mode_t mode, char *p) { + _DIAGASSERT(p != NULL); + /* print type */ switch (mode & S_IFMT) { case S_IFDIR: /* directory */ @@ -65,9 +90,11 @@ strmode(mode, p) case S_IFLNK: /* symbolic link */ *p++ = 'l'; break; +#ifdef S_IFSOCK case S_IFSOCK: /* socket */ *p++ = 's'; break; +#endif #ifdef S_IFIFO case S_IFIFO: /* fifo */ *p++ = 'p'; @@ -78,6 +105,11 @@ strmode(mode, p) *p++ = 'w'; break; #endif +#ifdef S_IFDOOR + case S_IFDOOR: /* door */ + *p++ = 'D'; + break; +#endif default: /* unknown */ *p++ = '?'; break; @@ -154,3 +186,4 @@ strmode(mode, p) *p++ = ' '; /* will be a '+' if ACL's implemented */ *p = '\0'; } +#endif /* !HAVE_STRMODE */