Page MenuHomeFreeBSD

D21109.diff
No OneTemporary

D21109.diff

Index: head/usr.sbin/autofs/autounmountd.c
===================================================================
--- head/usr.sbin/autofs/autounmountd.c
+++ head/usr.sbin/autofs/autounmountd.c
@@ -179,12 +179,12 @@
return (error);
}
-static double
-expire_automounted(double expiration_time)
+static time_t
+expire_automounted(time_t expiration_time)
{
struct automounted_fs *af, *tmpaf;
time_t now;
- double mounted_for, mounted_max = -1.0;
+ time_t mounted_for, mounted_max = -1;
int error;
now = time(NULL);
@@ -196,9 +196,9 @@
if (mounted_for < expiration_time) {
log_debugx("skipping %s (FSID:%d:%d), mounted "
- "for %.0f seconds", af->af_mountpoint,
+ "for %ld seconds", af->af_mountpoint,
af->af_fsid.val[0], af->af_fsid.val[1],
- mounted_for);
+ (long)mounted_for);
if (mounted_for > mounted_max)
mounted_max = mounted_for;
@@ -207,9 +207,9 @@
}
log_debugx("filesystem mounted on %s (FSID:%d:%d), "
- "was mounted for %.0f seconds; unmounting",
+ "was mounted for %ld seconds; unmounting",
af->af_mountpoint, af->af_fsid.val[0], af->af_fsid.val[1],
- mounted_for);
+ (long)mounted_for);
error = unmount_by_fsid(af->af_fsid, af->af_mountpoint);
if (error != 0) {
if (mounted_for > mounted_max)
@@ -229,18 +229,19 @@
}
static void
-do_wait(int kq, double sleep_time)
+do_wait(int kq, time_t sleep_time)
{
struct timespec timeout;
struct kevent unused;
int nevents;
- if (sleep_time != -1.0) {
- assert(sleep_time > 0.0);
+ if (sleep_time != -1) {
+ assert(sleep_time > 0);
timeout.tv_sec = sleep_time;
timeout.tv_nsec = 0;
- log_debugx("waiting for filesystem event for %.0f seconds", sleep_time);
+ log_debugx("waiting for filesystem event for %ld seconds",
+ (long)sleep_time);
nevents = kevent(kq, NULL, 0, &unused, 1, &timeout);
} else {
log_debugx("waiting for filesystem event");
@@ -254,7 +255,7 @@
if (nevents == 0) {
log_debugx("timeout reached");
- assert(sleep_time > 0.0);
+ assert(sleep_time > 0);
} else {
log_debugx("got filesystem event");
}
@@ -268,7 +269,7 @@
pid_t otherpid;
const char *pidfile_path = AUTOUNMOUNTD_PIDFILE;
int ch, debug = 0, error, kq;
- double expiration_time = 600, retry_time = 600, mounted_max, sleep_time;
+ time_t expiration_time = 600, retry_time = 600, mounted_max, sleep_time;
bool dont_daemonize = false;
while ((ch = getopt(argc, argv, "dr:t:v")) != -1) {
@@ -336,17 +337,17 @@
for (;;) {
refresh_automounted();
mounted_max = expire_automounted(expiration_time);
- if (mounted_max == -1.0) {
+ if (mounted_max == -1) {
sleep_time = mounted_max;
log_debugx("no filesystems to expire");
} else if (mounted_max < expiration_time) {
sleep_time = difftime(expiration_time, mounted_max);
- log_debugx("some filesystems expire in %.0f seconds",
- sleep_time);
+ log_debugx("some filesystems expire in %ld seconds",
+ (long)sleep_time);
} else {
sleep_time = retry_time;
log_debugx("some expired filesystems remain mounted, "
- "will retry in %.0f seconds", sleep_time);
+ "will retry in %ld seconds", (long)sleep_time);
}
do_wait(kq, sleep_time);

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 2, 4:47 AM (9 h, 58 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30704309
Default Alt Text
D21109.diff (3 KB)

Event Timeline