Implement "putty -cleanup"
[u/mdw/putty] / noise.c
diff --git a/noise.c b/noise.c
index 3ff00be..383e6c3 100644 (file)
--- a/noise.c
+++ b/noise.c
@@ -108,6 +108,16 @@ void random_save_seed(void) {
 }
 
 /*
+ * This function is called from `putty -cleanup'. It removes the
+ * random seed file.
+ */
+void random_destroy_seed(void) {
+    if (!seedpath[0])
+       get_seedpath();
+    remove(seedpath);
+}
+
+/*
  * This function is called every time the random pool needs
  * stirring, and will acquire the system time in all available
  * forms and the battery status.
@@ -124,8 +134,10 @@ void noise_get_light(void (*func) (void *, int)) {
     GetSystemTimeAdjustment(&adjust[0], &adjust[1], &rubbish);
     func(&adjust, sizeof(adjust));
 
+#ifndef WIN32S_COMPAT
     if (GetSystemPowerStatus(&pwrstat))
        func(&pwrstat, sizeof(pwrstat));
+#endif
 }
 
 /*