mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 19:52:20 +00:00
Make dtlogin compile on OpenBSD.
Most importantly, we *cannot* do the utmp stuff this code is attempting. It is SysV-specific.
This commit is contained in:
parent
a8d5c1f0ba
commit
7c3a972d32
4 changed files with 22 additions and 3 deletions
|
@ -138,6 +138,7 @@ Account( struct display *d, char *user, char *line, pid_t pid,
|
|||
#endif /* NeedWidePrototypes */
|
||||
waitType exitcode )
|
||||
{
|
||||
#if !defined(CSRG_BASED) /* we cannot do this on BSD ... */
|
||||
struct utmp utmp; /* local struct for new entry */
|
||||
struct utmp *u; /* pointer to entry in utmp file */
|
||||
int fd;
|
||||
|
@ -348,6 +349,7 @@ Account( struct display *d, char *user, char *line, pid_t pid,
|
|||
#endif
|
||||
|
||||
#endif /* !sun */
|
||||
#endif /* !CSRG_BASED */
|
||||
}
|
||||
|
||||
|
||||
|
@ -369,6 +371,7 @@ UtmpIdOpen( char *utmpId )
|
|||
struct utmp *u; /* pointer to entry in utmp file */
|
||||
int status = 1; /* return code */
|
||||
|
||||
#if !defined(CSRG_BASED)
|
||||
while ( (u = getutent()) != NULL ) {
|
||||
|
||||
if ( (strncmp(u->ut_id, utmpId, 4) == 0 ) &&
|
||||
|
@ -380,6 +383,7 @@ UtmpIdOpen( char *utmpId )
|
|||
}
|
||||
|
||||
endutent();
|
||||
#endif
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
|
|
@ -515,7 +515,7 @@ StopAll( int arg )
|
|||
|
||||
int ChildReady = 0;
|
||||
|
||||
#if !defined(SYSV) || defined(hpux) || defined(_AIX) || defined(__uxp__) || defined (__osf__) || defined(linux)
|
||||
#if !defined(SYSV) || defined(hpux) || defined(_AIX) || defined(__uxp__) || defined (__osf__) || defined(linux) || defined(CSRG_BASED)
|
||||
static SIGVAL
|
||||
ChildNotify( int arg )
|
||||
{
|
||||
|
@ -599,7 +599,9 @@ ProcessChildDeath( int pid, waitType status )
|
|||
* do process accounting...
|
||||
*/
|
||||
|
||||
#if !defined(CSRG_BASED)
|
||||
Account(d, NULL, NULL, pid, DEAD_PROCESS, status);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -732,7 +734,9 @@ ProcessChildDeath( int pid, waitType status )
|
|||
* do process accounting...
|
||||
*/
|
||||
|
||||
#if !defined(CSRG_BASED)
|
||||
Account(d, NULL, NULL, pid, DEAD_PROCESS, status);
|
||||
#endif
|
||||
|
||||
switch (d->status)
|
||||
{
|
||||
|
@ -1030,6 +1034,7 @@ StartDisplay(
|
|||
* are already in use...
|
||||
*/
|
||||
|
||||
#if !defined(CSRG_BASED)
|
||||
if (d->utmpId == NULL) {
|
||||
int i;
|
||||
char *p, *q;
|
||||
|
@ -1061,6 +1066,7 @@ StartDisplay(
|
|||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (NULL == d->authFile)
|
||||
|
@ -1150,7 +1156,9 @@ StartDisplay(
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#if !defined(CSRG_BASED)
|
||||
Account(d, "LOGIN", line, getpid(), LOGIN_PROCESS, status);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!WaitForServer (d))
|
||||
|
@ -1244,7 +1252,9 @@ StopDisplay( struct display *d )
|
|||
else
|
||||
if ((d->displayType.location == Local) || !dt_shutdown ) {
|
||||
/* don't remove the console */
|
||||
#if !defined(CSRG_BASED)
|
||||
Account(d, NULL, NULL, 0, DEAD_PROCESS, status);
|
||||
#endif
|
||||
RemoveDisplay (d);
|
||||
}
|
||||
}
|
||||
|
@ -1546,7 +1556,9 @@ StartGetty( struct display *d )
|
|||
/*
|
||||
* do process accounting...
|
||||
*/
|
||||
#if !defined(CSRG_BASED)
|
||||
Account(d, "LOGIN", NULL, getpid(), LOGIN_PROCESS, status);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _AIX
|
||||
|
@ -1723,6 +1735,7 @@ GettyRunning( struct display *d )
|
|||
|
||||
Debug("Checking for a getty on line %s.\n", utmp.ut_line);
|
||||
|
||||
#if !defined(CSRG_BASED)
|
||||
setutent();
|
||||
|
||||
rvalue = FALSE;
|
||||
|
@ -1760,6 +1773,7 @@ GettyRunning( struct display *d )
|
|||
}
|
||||
|
||||
endutent();
|
||||
#endif /* !CSRG_BASED */
|
||||
return rvalue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1290,7 +1290,7 @@ StartClient( struct verify_info *verify, struct display *d, int *pidp )
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef sun
|
||||
#if !defined(sun) && !defined(CSRG_BASED)
|
||||
Account(d, user, NULL, getpid(), USER_PROCESS, status);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -679,7 +679,8 @@ static int
|
|||
MatchesFileSuffix(char *filename, char *suffix)
|
||||
{
|
||||
int retval = 0;
|
||||
#if defined(_AIX) || defined(SVR4) || defined (__osf__) || defined(linux)
|
||||
#if defined(_AIX) || defined(SVR4) || defined (__osf__) || defined(linux) || \
|
||||
defined(CSRG_BASED)
|
||||
char *pch;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue