]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Monitor.c
Makefile improvements for static linking.
[thirdparty/mdadm.git] / Monitor.c
index 6bc7ea16e2dc0a7cdc6dd362d668d2017df8a775..246b9c501d1fcbe378eedc543106fd8171c8921e 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -1,7 +1,7 @@
 /*
  * mdadm - manage Linux "md" devices aka RAID arrays.
  *
- * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
+ * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
  *
  *
  *    This program is free software; you can redistribute it and/or modify
@@ -385,6 +385,7 @@ int Monitor(mddev_dev_t devlist,
                                                if (fd >=0) close(fd);
                                                free(st->devname);
                                                free(st);
+                                               put_md_name(st->devname);
                                                continue;
                                        }
                                        close(fd);
@@ -520,7 +521,7 @@ static void alert(char *event, char *dev, char *disc, char *mailaddr, char *mail
                                int n;
                                fprintf(mp, "\nP.S. The /proc/mdstat file current contains the following:\n\n");
                                while ( (n=fread(buf, 1, sizeof(buf), mdstat)) > 0)
-                                       fwrite(buf, 1, n, mp);
+                                       n=fwrite(buf, 1, n, mp); /* yes, i don't care about the result */
                                fclose(mdstat);
                        }
                        fclose(mp);