Don't redefine errno(3)
It is Undefined Behavior to declare errno (see NOTES in its manual page). Instead of using the errno dummy declaration, use one that doesn't need a comment. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
parent
ed69feaaff
commit
e2df287aad
@ -502,5 +502,5 @@ int putsgent (const struct sgrp *sgrp, FILE * fp)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /*} SHADOWGRP */
|
#endif /*} SHADOWGRP */
|
||||||
|
@ -81,5 +81,5 @@ int ulckpwdf (void)
|
|||||||
return (pw_unlock () && spw_unlock ())? 0 : -1;
|
return (pw_unlock () && spw_unlock ())? 0 : -1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif
|
#endif
|
||||||
|
@ -53,6 +53,6 @@ int nscd_flush_cache (const char *service)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else /* USE_NSCD */
|
#else /* USE_NSCD */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* USE_NSCD */
|
#endif /* USE_NSCD */
|
||||||
|
|
||||||
|
@ -207,5 +207,5 @@ int pw_auth (const char *cipher,
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
#else /* !USE_PAM */
|
#else /* !USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
|
@ -206,5 +206,5 @@ int check_selinux_permit (const char *perm_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* !WITH_SELINUX */
|
#else /* !WITH_SELINUX */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !WITH_SELINUX */
|
#endif /* !WITH_SELINUX */
|
||||||
|
@ -357,5 +357,5 @@ done:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else /* !WITH_SELINUX */
|
#else /* !WITH_SELINUX */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !WITH_SELINUX */
|
#endif /* !WITH_SELINUX */
|
||||||
|
@ -182,6 +182,6 @@ struct spwd *sgetspent (const char *string)
|
|||||||
return (&spwd);
|
return (&spwd);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -302,5 +302,5 @@ int sgr_sort ()
|
|||||||
return commonio_sort_wrt (&gshadow_db, __gr_get_db ());
|
return commonio_sort_wrt (&gshadow_db, __gr_get_db ());
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif
|
#endif
|
||||||
|
@ -525,6 +525,6 @@ struct spwd *getspnam (const char *name)
|
|||||||
return (sp);
|
return (sp);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -70,6 +70,6 @@ int sssd_flush_cache (int dbflags)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else /* USE_SSSD */
|
#else /* USE_SSSD */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* USE_SSSD */
|
#endif /* USE_SSSD */
|
||||||
|
|
||||||
|
@ -1097,6 +1097,6 @@ bool release_subid_range(struct subordinate_range *range, enum subid_type id_typ
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* !ENABLE_SUBIDS */
|
#else /* !ENABLE_SUBIDS */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !ENABLE_SUBIDS */
|
#endif /* !ENABLE_SUBIDS */
|
||||||
|
|
||||||
|
@ -66,5 +66,5 @@ struct utmp *getutent (void)
|
|||||||
return &utmp_buf;
|
return &utmp_buf;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif
|
#endif
|
||||||
|
@ -109,6 +109,6 @@ int add_groups (const char *list)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else /* HAVE_SETGROUPS && !USE_PAM */
|
#else /* HAVE_SETGROUPS && !USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* HAVE_SETGROUPS && !USE_PAM */
|
#endif /* HAVE_SETGROUPS && !USE_PAM */
|
||||||
|
|
||||||
|
@ -82,6 +82,6 @@ void audit_logger_message (const char *message, shadow_audit_result result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* WITH_AUDIT */
|
#else /* WITH_AUDIT */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* WITH_AUDIT */
|
#endif /* WITH_AUDIT */
|
||||||
|
|
||||||
|
@ -59,6 +59,6 @@ int find_new_sub_gids (gid_t *range_start, unsigned long *range_count)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else /* !ENABLE_SUBIDS */
|
#else /* !ENABLE_SUBIDS */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !ENABLE_SUBIDS */
|
#endif /* !ENABLE_SUBIDS */
|
||||||
|
|
||||||
|
@ -59,6 +59,6 @@ int find_new_sub_uids (uid_t *range_start, unsigned long *range_count)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else /* !ENABLE_SUBIDS */
|
#else /* !ENABLE_SUBIDS */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !ENABLE_SUBIDS */
|
#endif /* !ENABLE_SUBIDS */
|
||||||
|
|
||||||
|
@ -550,6 +550,6 @@ void setup_limits (const struct passwd *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* !USE_PAM */
|
#else /* !USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
|
|
||||||
|
@ -302,5 +302,5 @@ bool obscure (const char *old, const char *new, const struct passwd *pwdp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* !USE_PAM */
|
#else /* !USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
|
@ -55,5 +55,5 @@ void do_pam_passwd (const char *user, bool silent, bool change_expired)
|
|||||||
(void) pam_end (pamh, PAM_SUCCESS);
|
(void) pam_end (pamh, PAM_SUCCESS);
|
||||||
}
|
}
|
||||||
#else /* !USE_PAM */
|
#else /* !USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
|
@ -141,5 +141,5 @@ int do_pam_passwd_non_interactive (const char *pam_service,
|
|||||||
return ((PAM_SUCCESS == ret) ? 0 : 1);
|
return ((PAM_SUCCESS == ret) ? 0 : 1);
|
||||||
}
|
}
|
||||||
#else /* !USE_PAM */
|
#else /* !USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
|
@ -62,6 +62,6 @@ struct spwd *pwd_to_spwd (const struct passwd *pw)
|
|||||||
return &sp;
|
return &sp;
|
||||||
}
|
}
|
||||||
#else /* USE_PAM */
|
#else /* USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
|
|
||||||
|
@ -34,5 +34,5 @@ void passwd_check (const char *user, const char *passwd, unused const char *prog
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* USE_PAM */
|
#else /* USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* USE_PAM */
|
#endif /* USE_PAM */
|
||||||
|
@ -52,6 +52,6 @@
|
|||||||
return tzbuf;
|
return tzbuf;
|
||||||
}
|
}
|
||||||
#else /* !USE_PAM */
|
#else /* !USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
|
|
||||||
|
@ -335,5 +335,5 @@ static bool string_match (const char *tok, const char *string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* !USE_PAM */
|
#else /* !USE_PAM */
|
||||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
|
Loading…
Reference in New Issue
Block a user