- Timestamp:
- May 1, 2007, 8:56:49 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_processcheck.c
r102 r103 798 798 unsigned int pos = 0; 799 799 char tstr[256]; 800 enum { SKIP_ WS, SKIP_WS2, GET_NUM, SKIP_END, GET_NUM2 } line;800 enum { SKIP_TO_WS, SKIP_WS, SKIP_TO_WS2, SKIP_WS2, GET_NUM, SKIP_END, GET_NUM2 } line; 801 801 802 802 SL_ENTER(_("sh_processes_readps")); … … 861 861 } 862 862 break; 863 case SKIP_TO_WS: 864 if (!isspace(cc)) 865 break; 866 line = SKIP_WS; 867 /* fallthrough */ 863 868 case SKIP_WS: 864 869 if (isspace(cc)) … … 873 878 break; 874 879 } 880 else if (isspace(cc)) 881 { 875 882 #ifdef HAVE_THREADS 876 num = 0; 883 num = 0; 884 line = SKIP_WS2; 885 #else 886 if (num < sh_prochk_maxpid && num >= sh_prochk_minpid) 887 { 888 res[num - sh_prochk_minpid] |= flag; 889 } 890 line = SKIP_END; 891 #endif 892 break; 893 } 894 else 895 { 896 line = SKIP_TO_WS; 897 break; 898 } 899 case SKIP_TO_WS2: 900 if (!isspace(cc)) 901 break; 877 902 line = SKIP_WS2; 878 #else 879 if (num < sh_prochk_maxpid && num >= sh_prochk_minpid) 880 { 881 res[num - sh_prochk_minpid] |= flag; 882 } 883 line = SKIP_END; 884 #endif 885 break; 903 /* fallthrough */ 886 904 case SKIP_WS2: 887 905 if (isspace(cc)) … … 896 914 break; 897 915 } 898 if (num < sh_prochk_maxpid && num >= sh_prochk_minpid) 899 { 900 res[num - sh_prochk_minpid] |= flag; 901 } 902 line = SKIP_END; 903 break; 916 else if (isspace(cc)) 917 { 918 if (num < sh_prochk_maxpid && num >= sh_prochk_minpid) 919 { 920 res[num - sh_prochk_minpid] |= flag; 921 } 922 line = SKIP_END; 923 break; 924 } 925 else 926 { 927 line = SKIP_TO_WS2; 928 break; 929 } 904 930 default: 905 931 SL_RETURN ((-1), _("sh_processes_readps")); … … 993 1019 */ 994 1020 (void) sh_ext_pclose(&task); 1021 sh_ext_tas_free (&task); 995 1022 SL_RETURN ((retval), _("sh_processes_runps")); 996 1023 } … … 1175 1202 (unsigned long) sh_prochk_minpid, 1176 1203 (unsigned long) (sh_prochk_maxpid-1)); 1204 1205 if (sh_prochk_res) { 1206 memset (sh_prochk_res, 0, sizeof(short) * sh_prochk_size); 1207 } 1177 1208 status = sh_process_check_int(sh_prochk_res); 1209 1178 1210 if (status != 0) 1179 1211 ShProchkActive = S_FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.