#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header$");
+RCSID
+ ("$Header$");
#include <sys/types.h>
#include <sys/file.h>
/* 0 on failure, 1 on success */
logout(line)
- register char *line;
+ register char *line;
{
- register FILE *fp;
- struct utmp ut;
- int rval;
+ register FILE *fp;
+ struct utmp ut;
+ int rval;
- if (!(fp = fopen(UTMPFILE, "r+")))
- return(0);
- rval = 0;
- while (fread((char *)&ut, sizeof(struct utmp), 1, fp) == 1) {
- if (!ut.ut_name[0] ||
- strncmp(ut.ut_line, line, sizeof(ut.ut_line)))
- continue;
- memset(ut.ut_name, 0, sizeof(ut.ut_name));
+ if (!(fp = fopen(UTMPFILE, "r+")))
+ return (0);
+ rval = 0;
+ while (fread((char *)&ut, sizeof(struct utmp), 1, fp) == 1) {
+ if (!ut.ut_name[0] || strncmp(ut.ut_line, line, sizeof(ut.ut_line)))
+ continue;
+ memset(ut.ut_name, 0, sizeof(ut.ut_name));
#if !defined(AIX) && !defined(AFS_SUN5_ENV)
- memset(ut.ut_host, 0, sizeof(ut.ut_host));
+ memset(ut.ut_host, 0, sizeof(ut.ut_host));
#endif /* AIX */
- (void)time(&ut.ut_time);
- (void)fseek(fp, (long)-sizeof(struct utmp), L_INCR);
- (void)fwrite((char *)&ut, sizeof(struct utmp), 1, fp);
- (void)fseek(fp, (long)0, L_INCR);
- rval = 1;
- }
- (void)fclose(fp);
- return(rval);
+ (void)time(&ut.ut_time);
+ (void)fseek(fp, (long)-sizeof(struct utmp), L_INCR);
+ (void)fwrite((char *)&ut, sizeof(struct utmp), 1, fp);
+ (void)fseek(fp, (long)0, L_INCR);
+ rval = 1;
+ }
+ (void)fclose(fp);
+ return (rval);
}