On Sun, Sep 27, 2009 at 03:40:31PM -0500, Marco Peereboom wrote:
> I created a new version that adds restartable recovery operation. I
> needed this to recover my tivo after a disk simply stopped responding
> after a while. So I restarted it until I had the whole damn thing
> recovered.
>
> snap at: http://www.peereboom.us/diskrescue/snapshot/diskrescue-0.2.tgz
>
Hello Marco,
$ sudo ./diskrescue -r /dev/rsd0c -b 1m -R res verify
0.1%
<<hit ^C>>
terminating
Segmentation fault (core dumped)
#0 fclose (fp=0x0) at /usr/src/lib/libc/stdio/fclose.c:44
#1 0x00000000004020ad in main ()
--- diskrescue.c.orig Sun Sep 27 15:03:01 2009
+++ diskrescue.c Sun Sep 27 15:10:53 2009
@@ -562,10 +562,16 @@
printf("\r%.1f%%\n", 100.0);
done:
- fflush(ofd);
- fflush(resfd);
- fclose(ofd);
- fclose(resfd);
+ if (outfile) {
+ fflush(ofd);
+ fclose(ofd);
+ }
+
+ if (resfile) {
+ fflush(resfd);
+ fclose(resfd);
+ }
+
close(fd);
return (0);