From 428b7ea22f1199a9c7a8c0c3972a676eeb135cfa Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 12 Mar 2002 01:50:49 +0000 Subject: libdiskfs/ 2002-03-12 Marcus Brinkmann * opts-append-std.c (diskfs_append_std_options): Only add --sync=N or --no-sync option if it is not the default. TODO/ * Remove the item related to the above change. --- TODO | 3 --- libdiskfs/ChangeLog | 5 +++++ libdiskfs/opts-append-std.c | 15 +++++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/TODO b/TODO index 9cfa1d9f..e38d869f 100644 --- a/TODO +++ b/TODO @@ -126,9 +126,6 @@ See `tasks', the exported task list. (syslog, but takes special care when the root file system?). !! *** Some of diskfs_readonly_changed in ufs/ext2fs should be in generic routines. ! -*** diskfs_default_sync_interval should not be changed, keeping the option - setting elsewhere, so that diskfs_append_std_options can elide the - --sync=N option when it reflects the default setting. ** libfshelp *** Put functions here to deal with directory and file change notifications !!! diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog index c4f5d0bc..bdcaf857 100644 --- a/libdiskfs/ChangeLog +++ b/libdiskfs/ChangeLog @@ -1,3 +1,8 @@ +2002-03-12 Marcus Brinkmann + + * opts-append-std.c (diskfs_append_std_options): Only add --sync=N + or --no-sync option if it is not the default. + 2002-03-06 Roland McGrath * dir-mkfile.c (diskfs_S_dir_mkfile): Clear OPENONLY_STATE_MODES bits diff --git a/libdiskfs/opts-append-std.c b/libdiskfs/opts-append-std.c index f6083365..00e858fc 100644 --- a/libdiskfs/opts-append-std.c +++ b/libdiskfs/opts-append-std.c @@ -47,13 +47,16 @@ diskfs_append_std_options (char **argz, unsigned *argz_len) { if (diskfs_synchronous) err = argz_add (argz, argz_len, "--sync"); - else if (diskfs_sync_interval == 0) - err = argz_add (argz, argz_len, "--no-sync"); - else + else if (DEFAULT_SYNC_INTERVAL != diskfs_sync_interval) { - char buf[80]; - sprintf (buf, "--sync=%d", diskfs_sync_interval); - err = argz_add (argz, argz_len, buf); + if (diskfs_sync_interval == 0) + err = argz_add (argz, argz_len, "--no-sync"); + else + { + char buf[80]; + sprintf (buf, "--sync=%d", diskfs_sync_interval); + err = argz_add (argz, argz_len, buf); + } } } -- cgit v1.2.3