When creating a logfile name, add a sequence number to the name in case
a logfile for that pid already exists.  This may happen for programs
started during system boot which will tend to get the same pid each boot.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1928 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_procselfmaps.c b/coregrind/vg_procselfmaps.c
index 6350b56..33186f1 100644
--- a/coregrind/vg_procselfmaps.c
+++ b/coregrind/vg_procselfmaps.c
@@ -77,7 +77,7 @@
    
    /* Read the initial memory mapping from the /proc filesystem. */
    fd = VG_(open) ( "/proc/self/maps", VKI_O_RDONLY, 0 );
-   if (fd == -1) {
+   if (fd < 0) {
       VG_(message)(Vg_UserMsg, "FATAL: can't open /proc/self/maps");
       VG_(exit)(1);
    }