Changeset 154 for trunk/src/sh_utmp.c
- Timestamp:
- Jan 12, 2008, 7:04:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_utmp.c
r153 r154 771 771 #endif 772 772 773 /* These variables are not used anywhere. They only exist 774 * to assign &userold, &user to them, which keeps gcc from 775 * putting them into a register, and avoids the 'clobbered 776 * by longjmp' warning. And no, 'volatile' proved insufficient. 777 */ 778 void * sh_dummy_userold = NULL; 779 void * sh_dummy_user = NULL; 780 781 773 782 static void sh_utmp_addlogin (struct SH_UTMP_S * ut) 774 783 { 775 struct 776 volatilestruct log_user * userold = userlist;784 struct log_user * user = userlist; 785 struct log_user * userold = userlist; 777 786 #ifdef HAVE_UTTYPE 778 787 struct log_user * username = userlist; … … 785 794 786 795 SL_ENTER(_("sh_utmp_addlogin")); 796 797 /* Take the address to keep gcc from putting them into registers. 798 * Avoids the 'clobbered by longjmp' warning. 799 */ 800 sh_dummy_userold = (void*) &userold; 801 sh_dummy_user = (void*) &user; 787 802 788 803 if (ut->ut_line[0] == '\0') … … 804 819 while (user != NULL) 805 820 { 806 if (0 == sl_strncmp( user->ut_tty, ut->ut_line, UT_LINESIZE) )821 if (0 == sl_strncmp((char*)(user->ut_tty), ut->ut_line, UT_LINESIZE) ) 807 822 break; 808 823 userold = user; … … 827 842 user = SH_ALLOC(sizeof(struct log_user)); 828 843 user->next = userlist; 829 userlist = user;844 userlist = (struct log_user *) user; 830 845 } 831 (void) sl_strlcpy( user->ut_tty, ut->ut_line, UT_LINESIZE+1);832 (void) sl_strlcpy( user->name, ut->ut_name, UT_NAMESIZE+1);846 (void) sl_strlcpy((char*)(user->ut_tty), ut->ut_line, UT_LINESIZE+1); 847 (void) sl_strlcpy((char*)(user->name), ut->ut_name, UT_NAMESIZE+1); 833 848 #ifdef HAVE_UTHOST 834 (void) sl_strlcpy( user->ut_host, ut->ut_host, UT_HOSTSIZE+1);849 (void) sl_strlcpy((char*)(user->ut_host), ut->ut_host, UT_HOSTSIZE+1); 835 850 #else 836 851 user->ut_host[0] = '\0'; … … 838 853 #ifdef HAVE_UTADDR 839 854 /*@-type@*//* ut_addr does exist !!! */ 840 (void) sl_strlcpy( user->ut_ship,855 (void) sl_strlcpy((char*)(user->ut_ship), 841 856 my_inet_ntoa(*(struct in_addr*)&(ut->ut_addr)), 16); 842 857 /*@+type@*/ … … 848 863 || 0 == sl_strncmp(ut->ut_line, _("ttyq"), 4) /* in virt. console */ 849 864 ) { 850 status = sh_utmp_login_a( user->name);865 status = sh_utmp_login_a((char*)user->name); 851 866 SH_MUTEX_LOCK(mutex_thread_nolog); 852 867 (void) sh_unix_time (user->time, ttt, TIM_MAX); … … 872 887 SH_MUTEX_UNLOCK(mutex_thread_nolog); 873 888 } else 874 if (0 != sh_utmp_is_virtual(ut->ut_line, user->ut_host))889 if (0 != sh_utmp_is_virtual(ut->ut_line, (char*)user->ut_host)) 875 890 { 876 status = sh_utmp_login_a( user->name);891 status = sh_utmp_login_a((char*)user->name); 877 892 SH_MUTEX_LOCK(mutex_thread_nolog); 878 893 (void) sh_unix_time (user->time, ttt, TIM_MAX); … … 911 926 if (user != NULL) 912 927 { 913 status = sh_utmp_login_r( user->name);928 status = sh_utmp_login_r((char*)user->name); 914 929 SH_MUTEX_LOCK(mutex_thread_nolog); 915 930 (void) sh_unix_time (ut->ut_time, ttt, TIM_MAX); … … 937 952 if (user == userlist) 938 953 userlist = user->next; 939 sh_utmp_logout_morechecks( user);940 SH_FREE( user);954 sh_utmp_logout_morechecks((struct log_user *)user); 955 SH_FREE((struct log_user *)user); 941 956 user = NULL; 942 957 }
Note:
See TracChangeset
for help on using the changeset viewer.