ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/user_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/user_stats.c (file contents):
Revision 1.20 by ats, Sun Apr 4 23:45:03 2004 UTC vs.
Revision 1.23 by tdb, Tue Apr 6 14:52:58 2004 UTC

# Line 1 | Line 1
1   /*
2 < * i-scream central monitoring system
2 > * i-scream libstatgrab
3   * http://www.i-scream.org
4   * Copyright (C) 2000-2004 i-scream
5   *
# Line 44 | Line 44
44   #include <sys/unistd.h>
45   #endif
46  
47 < user_stat_t *get_user_stats(){
47 > sg_user_stats *sg_get_user_stats(){
48          int num_users = 0, pos = 0, new_pos;
49          VECTOR_DECLARE_STATIC(name_list, char, 128, NULL, NULL);
50 <        static user_stat_t user_stats;
50 >        static sg_user_stats user_stats;
51   #if defined(SOLARIS) || defined(LINUX) || defined(CYGWIN)
52          struct utmp *entry;
53   #endif
# Line 97 | Line 97 | user_stat_t *get_user_stats(){
97          if (num_users != 0) {
98                  pos--;
99          }
100 <        VECTOR_RESIZE(name_list, pos + 1);
100 >        if (VECTOR_RESIZE(name_list, pos + 1) < 0) {
101 >                return NULL;
102 >        }
103          name_list[pos] = '\0';
104  
105          user_stats.num_entries = num_users;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines