summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mount_nwfs
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>2000-04-05 10:48:53 +0000
committerbp <bp@FreeBSD.org>2000-04-05 10:48:53 +0000
commit3700a3909be426f0432696512e686f93a34dde8e (patch)
tree7666c0d1d0d2ad1e4847c85bcfcb6a2f98120660 /usr.sbin/mount_nwfs
parent8ba252e4e1282bc7512da73cc01ec710a64f9759 (diff)
downloadFreeBSD-src-3700a3909be426f0432696512e686f93a34dde8e.zip
FreeBSD-src-3700a3909be426f0432696512e686f93a34dde8e.tar.gz
Pass timezone information to an nwfs mount.
Diffstat (limited to 'usr.sbin/mount_nwfs')
-rw-r--r--usr.sbin/mount_nwfs/mount_nwfs.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/usr.sbin/mount_nwfs/mount_nwfs.c b/usr.sbin/mount_nwfs/mount_nwfs.c
index 7fb1ba9..02b45dd 100644
--- a/usr.sbin/mount_nwfs/mount_nwfs.c
+++ b/usr.sbin/mount_nwfs/mount_nwfs.c
@@ -35,6 +35,8 @@
#include <sys/stat.h>
#include <sys/errno.h>
#include <sys/mount.h>
+#include <sys/sysctl.h>
+#include <machine/cpu.h>
#include <stdio.h>
#include <string.h>
@@ -45,6 +47,7 @@
#include <stdlib.h>
#include <err.h>
#include <sysexits.h>
+#include <time.h>
#include <netncp/ncp_lib.h>
#include <netncp/ncp_rcfile.h>
@@ -69,15 +72,18 @@ parsercfile(struct ncp_conn_loginfo *li, struct nwfs_args *mdata) {
int
main(int argc, char *argv[]) {
- int opt, error, mntflags, nlsopt;
- char *p, *p1, tmp[1024];
- u_char *pv;
NWCONN_HANDLE connHandle;
struct nwfs_args mdata;
struct ncp_conn_loginfo li;
struct stat st;
struct vfsconf vfc;
struct nw_entry_info einfo;
+ struct tm *tm;
+ time_t ltime;
+ int opt, error, mntflags, nlsopt, wall_clock, len;
+ int mib[2];
+ char *p, *p1, tmp[1024];
+ u_char *pv;
if (argc < 2)
usage();
@@ -312,6 +318,18 @@ main(int argc, char *argv[]) {
mdata.nls = ncp_nls;
/* }*/
mdata.nls.opt = nlsopt;
+
+ mib[0] = CTL_MACHDEP;
+ mib[1] = CPU_WALLCLOCK;
+ len = sizeof(wall_clock);
+ if (sysctl(mib, 2, &wall_clock, &len, NULL, 0) == -1)
+ err(EX_OSERR, "get wall_clock");
+ if (wall_clock == 0) {
+ time(&ltime);
+ tm = localtime(&ltime);
+ mdata.tz = -(tm->tm_gmtoff / 60);
+ }
+
error = ncp_li_check(&li);
if (error)
return 1;
OpenPOWER on IntegriCloud