mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Declare file in the set function of setgetend functions.
This commit is contained in:
parent
4b1079510b
commit
360eaaf527
4 changed files with 8 additions and 8 deletions
|
@ -25,8 +25,6 @@
|
|||
#include <grp.h>
|
||||
#include <stddef.h>
|
||||
|
||||
extern "C" { FILE* __grp_file = NULL; }
|
||||
|
||||
extern "C" struct group* getgrent(void)
|
||||
{
|
||||
if ( !__grp_file && !(__grp_file = opengr()) )
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013, 2015.
|
||||
|
||||
This file is part of the Sortix C Library.
|
||||
|
||||
|
@ -25,10 +25,12 @@
|
|||
#include <grp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" { FILE* __grp_file = NULL; }
|
||||
|
||||
extern "C" void setgrent(void)
|
||||
{
|
||||
if ( __grp_file )
|
||||
fseeko(__grp_file, 0, SEEK_SET);
|
||||
rewind(__grp_file);
|
||||
else
|
||||
__grp_file = opengr();
|
||||
}
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include <stddef.h>
|
||||
#include <pwd.h>
|
||||
|
||||
extern "C" { FILE* __pwd_file = NULL; }
|
||||
|
||||
extern "C" struct passwd* getpwent(void)
|
||||
{
|
||||
if ( !__pwd_file && !(__pwd_file = openpw()) )
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013, 2015.
|
||||
|
||||
This file is part of the Sortix C Library.
|
||||
|
||||
|
@ -25,10 +25,12 @@
|
|||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" { FILE* __pwd_file = NULL; }
|
||||
|
||||
extern "C" void setpwent(void)
|
||||
{
|
||||
if ( __pwd_file )
|
||||
fseeko(__pwd_file, 0, SEEK_SET);
|
||||
rewind(__pwd_file);
|
||||
else
|
||||
__pwd_file = openpw();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue