Skip to content

Commit

Permalink
sethostname: provide local prototype for gethostname
Browse files Browse the repository at this point in the history
This is only to avoid warnings on some systems.
  • Loading branch information
bagder committed Aug 2, 2010
1 parent 40253e3 commit 687df5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/libtest/sethostname.c
Expand Up @@ -17,8 +17,10 @@
*
* Since some systems think this prototype doesn't match the system provided
* function, we AVOID including unistd.h or other headers that may include the
* original prototype!
* original prototype! We provide our own instead (to avoid warnings).
*/
int gethostname(char *name, size_t namelen);

int gethostname(char *name, size_t namelen)
{
const char *force_hostname = getenv(GETHOSTNAME_ENV_VAR);
Expand Down

0 comments on commit 687df5c

Please sign in to comment.