Changeset 142 for trunk/src/sh_utmp.c
- Timestamp:
- Oct 30, 2007, 12:17:00 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_utmp.c
r140 r142 455 455 static struct log_user * userlist = NULL; 456 456 static time_t lastcheck; 457 static int init_done = 0; 457 458 458 459 /************* … … 461 462 * 462 463 *************/ 463 int sh_utmp_init (struct mod_type * arg) 464 { 465 static int done = 0; 466 (void) arg; 464 465 static int sh_utmp_init_internal () 466 { 467 467 468 468 SL_ENTER(_("sh_utmp_init")); … … 472 472 /* do not re-initialize after a re-configuration 473 473 */ 474 if ( done == 1) {474 if (init_done == 1) { 475 475 SL_RETURN( (0), _("sh_utmp_init")); 476 476 } … … 480 480 sh_utmp_check_internal (2); /* current logins */ 481 481 sh_utmp_check_internal (0); 482 done = 1;482 init_done = 1; 483 483 SL_RETURN( (0), _("sh_utmp_init")); 484 } 485 486 int sh_utmp_init (struct mod_type * arg) 487 { 488 if (ShUtmpActive == BAD) 489 return SH_MOD_FAILED; 490 #ifdef HAVE_PTHREAD 491 if (arg != NULL && arg->initval < 0) 492 { 493 if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg)) 494 return SH_MOD_THREAD; 495 else 496 return SH_MOD_FAILED; 497 } 498 #endif 499 return sh_utmp_init_internal(); 484 500 } 485 501 … … 509 525 (void) sh_utmp_login_clean(); 510 526 #endif 527 /* Reset the flag, such that the module 528 * can be re-enabled. 529 */ 530 ShUtmpActive = S_TRUE; 531 init_done = 0; 511 532 SL_RETURN( (0), _("sh_utmp_end")); 512 533 } … … 536 557 { 537 558 SL_ENTER(_("sh_utmp_check")); 559 if (ShUtmpActive == BAD) 560 SL_RETURN( (-1), _("sh_utmp_check")); 538 561 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_UT_CHECK); 539 562 sh_utmp_check_internal (1);
Note:
See TracChangeset
for help on using the changeset viewer.