--- projects/libstatgrab/examples/process_snapshot.c 2004/04/03 16:55:38 1.1 +++ projects/libstatgrab/examples/process_snapshot.c 2004/04/03 21:02:10 1.2 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: process_snapshot.c,v 1.1 2004/04/03 16:55:38 tdb Exp $ + * $Id: process_snapshot.c,v 1.2 2004/04/03 21:02:10 tdb Exp $ */ #include @@ -41,6 +41,11 @@ int main(){ } ps_size = get_proc_snapshot(&ps); + + if(ps_size == NULL){ + fprintf(stderr, "Failed to get process snapshot\n"); + exit(1); + } printf("%5s %5s %5s %5s %5s %5s %5s %6s %6s %9s %-10s %-4s %-8s %-20s %s\n", "pid", "ppid", "pgid", "uid", "euid", "gid", "egid", "size", "res", "time", "cpu", "nice", "state", "name", "title");