FreeBSD Bugzilla – Attachment 173024 Details for
Bug 211394
[exp-run] POSIX conformance: make functions return void
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Upload the right file.
posix-return-void-2.diff (text/plain), 6.85 KB, created by
Ed Schouten
on 2016-07-26 21:51:15 UTC
(
hide
)
Description:
Upload the right file.
Filename:
MIME Type:
Creator:
Ed Schouten
Created:
2016-07-26 21:51:15 UTC
Size:
6.85 KB
patch
obsolete
>Index: include/grp.h >=================================================================== >--- include/grp.h (revision 303343) >+++ include/grp.h (working copy) >@@ -75,8 +75,7 @@ > struct group * (*)(gid_t)); > #endif > #if __XSI_VISIBLE >-/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ >-int setgrent(void); >+void setgrent(void); > #endif > #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE > int getgrgid_r(gid_t, struct group *, char *, size_t, >Index: include/stdlib.h >=================================================================== >--- include/stdlib.h (revision 303343) >+++ include/stdlib.h (working copy) >@@ -222,7 +222,7 @@ > unsigned short > *seed48(unsigned short[3]); > #ifndef _SETKEY_DECLARED >-int setkey(const char *); >+void setkey(const char *); > #define _SETKEY_DECLARED > #endif > char *setstate(/* const */ char *); >Index: include/unistd.h >=================================================================== >--- include/unistd.h (revision 303343) >+++ include/unistd.h (working copy) >@@ -560,7 +560,7 @@ > void sethostid(long); > int sethostname(const char *, int); > #ifndef _SETKEY_DECLARED >-int setkey(const char *); >+void setkey(const char *); > #define _SETKEY_DECLARED > #endif > int setlogin(const char *); >Index: include/xlocale/_locale.h >=================================================================== >--- include/xlocale/_locale.h (revision 303343) >+++ include/xlocale/_locale.h (working copy) >@@ -48,7 +48,7 @@ > #endif > > locale_t duplocale(locale_t base); >-int freelocale(locale_t loc); >+void freelocale(locale_t loc); > locale_t newlocale(int mask, const char *locale, locale_t base); > const char *querylocale(int mask, locale_t loc); > locale_t uselocale(locale_t loc); >Index: lib/libc/gen/crypt.c >=================================================================== >--- lib/libc/gen/crypt.c (revision 303343) >+++ lib/libc/gen/crypt.c (working copy) >@@ -75,11 +75,10 @@ > "WARNING! setkey(3) not present in the system!"); > > /* ARGSUSED */ >-int >+void > setkey(const char *key __unused) > { > fprintf(stderr, "WARNING! setkey(3) not present in the system!\n"); >- return (0); > } > > __warn_references(encrypt, >Index: lib/libc/gen/getgrent.3 >=================================================================== >--- lib/libc/gen/getgrent.3 (revision 303343) >+++ lib/libc/gen/getgrent.3 (working copy) >@@ -28,7 +28,7 @@ > .\" From: @(#)getgrent.3 8.2 (Berkeley) 4/19/94 > .\" $FreeBSD$ > .\" >-.Dd April 16, 2003 >+.Dd July 26, 2016 > .Dt GETGRENT 3 > .Os > .Sh NAME >@@ -60,7 +60,7 @@ > .Fn getgrgid_r "gid_t gid" "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result" > .Ft int > .Fn setgroupent "int stayopen" >-.Ft int >+.Ft void > .Fn setgrent void > .Ft void > .Fn endgrent void >@@ -188,14 +188,13 @@ > .Dv NULL > and the return value is 0, no matching entry exists.) > .Pp >-The functions >+The function > .Fn setgroupent >-and >-.Fn setgrent >-return the value 1 if successful, otherwise the value >+returns the value 1 if successful, otherwise the value > 0 is returned. > The functions >-.Fn endgrent >+.Fn endgrent , >+.Fn setgrent > and > .Fn setgrfile > have no return value. >Index: lib/libc/gen/getgrent.c >=================================================================== >--- lib/libc/gen/getgrent.c (revision 303343) >+++ lib/libc/gen/getgrent.c (working copy) >@@ -533,12 +533,10 @@ > return (rv); > } > >-/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ >-int >+void > setgrent(void) > { > (void)_nsdispatch(NULL, setgrent_dtab, NSDB_GROUP, "setgrent", defaultsrc, 0); >- return (1); > } > > >Index: lib/libc/locale/freelocale.3 >=================================================================== >--- lib/libc/locale/freelocale.3 (revision 303343) >+++ lib/libc/locale/freelocale.3 (working copy) >@@ -26,7 +26,7 @@ > .\" SUCH DAMAGE. > .\" > .\" $FreeBSD$ >-.Dd September 17, 2011 >+.Dd July 26, 2016 > .Dt FREELOCALE 3 > .Os > .Sh NAME >@@ -39,7 +39,7 @@ > .Lb libc > .Sh SYNOPSIS > .In locale.h >-.Ft int >+.Ft void > .Fn freelocale "locale_t locale" > .Sh DESCRIPTION > Frees a >@@ -47,8 +47,6 @@ > This relinquishes any resources held exclusively by this locale. > Note that locales share reference-counted components, > so a call to this function is not guaranteed to free all of the components. >-.Sh RETURN VALUES >-Returns 0 on success or -1 on error. > .Sh SEE ALSO > .Xr duplocale 3 , > .Xr localeconv 3 , >@@ -57,12 +55,5 @@ > .Xr uselocale 3 , > .Xr xlocale 3 > .Sh STANDARDS >-The >-.Fn freelocale >-function >-differs from >-.St -p1003.1-2008 >-in that its return type is >-.Vt int >-rather than >-.Vt void . >+This function conforms to >+.St -p1003.1-2008 . >Index: lib/libc/locale/xlocale.c >=================================================================== >--- lib/libc/locale/xlocale.c (revision 303343) >+++ lib/libc/locale/xlocale.c (working copy) >@@ -325,20 +325,18 @@ > * Free a locale_t. This is quite a poorly named function. It actually > * disclaims a reference to a locale_t, rather than freeing it. > */ >-int >+void > freelocale(locale_t loc) > { >- /* Fail if we're passed something that isn't a locale. */ >- if ((NULL == loc) || (LC_GLOBAL_LOCALE == loc)) { >- return (-1); >- } >- /* If we're passed the global locale, pretend that we freed it but don't >- * actually do anything. */ >- if (&__xlocale_global_locale == loc) { >- return (0); >- } >- xlocale_release(loc); >- return (0); >+ >+ /* >+ * Fail if we're passed something that isn't a locale. If we're >+ * passed the global locale, pretend that we freed it but don't >+ * actually do anything. >+ */ >+ if (loc != NULL && loc != LC_GLOBAL_LOCALE && >+ loc != &__xlocale_global_locale) >+ xlocale_release(loc); > } > > /* >Index: usr.sbin/pw/pw_vpw.c >=================================================================== >--- usr.sbin/pw/pw_vpw.c (revision 303343) >+++ usr.sbin/pw/pw_vpw.c (working copy) >@@ -131,13 +131,10 @@ > } > } > >-RET_SETGRENT >+void > vsetgrent(void) > { > vendgrent(); >-#if defined(__FreeBSD__) >- return 0; >-#endif > } > > static struct group * >Index: usr.sbin/pw/pwupd.h >=================================================================== >--- usr.sbin/pw/pwupd.h (revision 303343) >+++ usr.sbin/pw/pwupd.h (working copy) >@@ -38,12 +38,6 @@ > #include <stdbool.h> > #include <stringlist.h> > >-#if defined(__FreeBSD__) >-#define RET_SETGRENT int >-#else >-#define RET_SETGRENT void >-#endif >- > struct pwf { > int _altdir; > void (*_setpwent)(void); >@@ -51,7 +45,7 @@ > struct passwd * (*_getpwent)(void); > struct passwd * (*_getpwuid)(uid_t uid); > struct passwd * (*_getpwnam)(const char * nam); >- RET_SETGRENT (*_setgrent)(void); >+ void (*_setgrent)(void); > void (*_endgrent)(void); > struct group * (*_getgrent)(void); > struct group * (*_getgrgid)(gid_t gid); >@@ -141,7 +135,7 @@ > struct group * vgetgrent(void); > struct group * vgetgrgid(gid_t gid); > struct group * vgetgrnam(const char * nam); >-RET_SETGRENT vsetgrent(void); >+void vsetgrent(void); > void vendgrent(void); > > void copymkdir(int rootfd, char const * dir, int skelfd, mode_t mode, uid_t uid,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 211394
:
173020
|
173023
| 173024