On Tue, 21 Sep 2004 09:35:12 -0600 Bruce wrote:
BS> char dname[21];

BS>     unlink(dname);

As you discovered, unlink is for deleting file. You were probably thinking of
free(), which frees memory. But you don't need that either, since dname is a
an global array , not an allocated one.

BS> When I execute the while loop, it reads the directory and link information
BS> and prints it out correctly both times.  When I get to the for loop at the
BS> end, it prints a zero, then the device name (/dev/dsk/c4t6d0s7) for the
BS> LAST partition read (not the first one), then segfaults.

gdb (and it's gui counterpart, ddd), are useful for debugging segfaults.
Hopefully they show you where the segfault is, and that's often helpful.

Linking in memory debugging can help too (efence or dmalloc).

-- 
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to