From owner-freebsd-ports Fri Oct 25 14:04:16 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA14627 for ports-outgoing; Fri, 25 Oct 1996 14:04:16 -0700 (PDT) Received: from xenon.chromatic.com (xenon.chromatic.com [199.5.224.1]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id OAA14619 for ; Fri, 25 Oct 1996 14:04:12 -0700 (PDT) Received: from ohio.chromatic.com (ohio.chromatic.com [199.5.224.98]) by xenon.chromatic.com (8.7.5/8.7.3) with ESMTP id OAA12486; Fri, 25 Oct 1996 14:03:37 -0700 (PDT) Received: (from hua@localhost) by ohio.chromatic.com (8.7.5/8.7.3) id OAA13997; Fri, 25 Oct 1996 14:03:33 -0700 (PDT) Date: Fri, 25 Oct 1996 14:03:33 -0700 (PDT) From: Ernest Hua Message-Id: <199610252103.OAA13997@ohio.chromatic.com> To: freebsd-ports@freebsd.org Subject: BUG/PATCH: mtools-3.0 Cc: hua@ohio.chromatic.com Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I'm not sure how to submit a bug report (with a patch) for a ported tool, so here it is. The first problem is that apparently none of the tools can find "a:", and it looks like there is no internal device table for FreeBSD. The second problem is that flock() is apparently not supported, so I kludged up something which warns that the locking mechanism (for writes) is not working. Once I got past these two problems, the tools appear to work fine. In case, the files are mangled because they're text, I've included the uuencoded gzip'ed versions below. Ern File "patch-4": *** ../mtools-3.0-pl3/devices.c Wed May 8 09:44:59 1996 --- devices.c Fri Oct 25 13:41:53 1996 *************** *** 146,161 **** --- 146,171 ---- { "/dev/rdsk/fds0d2.3.5hi", 'A', HD312}, { "/dev/rdsk/fds0d2.3.5", 'A', DD312}, { "/dev/rdsk/fds0d2.96", 'A', HD514}, {"/dev/rdsk/fds0d2.48", 'A', DD514}, }; #define INIT_NOOP #endif /* irix */ + + #ifdef __FreeBSD__ + #define predefined_devices + struct device devices[] = { + {"/dev/rfd0.1440", 'A', HD312}, + }; + #define INIT_NOOP + #endif /* __FreeBSD__ */ + + #ifdef sunos4 #include #include #define predefined_devices struct device devices[] = { {"/dev/rfd0c", 'A', GENFD}, }; File "patch-5": *** ../mtools-3.0-pl3/plain_io.c Sun May 12 12:24:19 1996 --- plain_io.c Fri Oct 25 13:41:54 1996 *************** *** 52,71 **** flk.l_start = 0L; flk.l_len = 0L; if (fcntl(fd, F_SETLK, &flk) < 0) #endif /* FCNTL */ #endif /* FLOCK */ #endif /* LOCKF */ { ! if(errno == EINVAL) return 0; ! else ! return 1; } return 0; } typedef int (*iofn) (int, char *, int); static int f_io(Stream_t *Stream, char *buf, int where, int len, iofn io) --- 52,76 ---- flk.l_start = 0L; flk.l_len = 0L; if (fcntl(fd, F_SETLK, &flk) < 0) #endif /* FCNTL */ #endif /* FLOCK */ #endif /* LOCKF */ { ! if (errno == EINVAL) return 0; ! #ifdef EOPNOTSUPP ! if (errno == EOPNOTSUPP) { ! fprintf(stderr, "Warning: Lock operation not supported\n"); ! return 0; ! } ! #endif /* EOPNOTSUPP */ ! return 1; } return 0; } typedef int (*iofn) (int, char *, int); static int f_io(Stream_t *Stream, char *buf, int where, int len, iofn io) *************** *** 268,284 **** } /* lock the device on writes */ if (mode == O_RDWR && lock_dev(This->fd)) { close(This->fd); Free(This); if(errmsg) sprintf(errmsg, ! "plain floppy: device \"%s\"busy\n:", dev->name); return NULL; } /* set default parameters, if needed */ if (dev){ if (init_geom(This->fd, dev, orig_dev, &This->stat)){ close(This->fd); --- 273,289 ---- } /* lock the device on writes */ if (mode == O_RDWR && lock_dev(This->fd)) { close(This->fd); Free(This); if(errmsg) sprintf(errmsg, ! "plain floppy: device \"%s\" busy\n:", dev->name); return NULL; } /* set default parameters, if needed */ if (dev){ if (init_geom(This->fd, dev, orig_dev, &This->stat)){ close(This->fd); begin 644 patch-4.gz M'XL("/`F<3(``W!A=&-H+30`A9!=:X,P&(6OVU_QTEX4_(BF1E?=!VRX;KU8 M.]A@%V/(,)&&.BW&CI72_[Y$*]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