Date: Fri, 25 Oct 1996 14:03:33 -0700 (PDT) From: Ernest Hua <hua@chromatic.com> To: freebsd-ports@freebsd.org Cc: hua@ohio.chromatic.com Subject: BUG/PATCH: mtools-3.0 Message-ID: <199610252103.OAA13997@ohio.chromatic.com>
next in thread | raw e-mail | index | archive | help
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 <sys/ioctl.h> #include <sun/dkio.h> #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$*]JM;$$D.>_#RSE'TS1`R/HH\SP5IH-L<YTZ M%F6?/&8"Q;T71N'A?0LP`=L/"`E<'[#O>WW3-*'%I@6'15S"V`7L!`0'KE-C MVO%1;\#$,["'H1+4GDHXPR#O9A_DV<%`>;`**E960H5-Q\A![I(/C-[H>F3` M?>C@\=[X"V[0\!_4]]JE+B8-^1LDDW9E`^[/Y6](6<(S!K/Y[#F:+Q:/2F,9 MY0E8&O""?X%F2:VOJV_($\E#%$T+QFZ>PBA2XF'%NF#UC4:'<N50E,5&=EL+ M3>FO;W`).SEMO2;41I@0^V=)NK*IG["I=VQV_"BWE565HW8K-EDN2/7.XG1# M&5R(K;!X'I<I6EX=#S:915<\K_5./R?"P9_A`'J=;'&3Z^YV/@V;^K\!>W9% %8\$"``!X ` end begin 644 patch-5.gz M'XL("`$G<3(``W!A=&-H+34`U53;3MM`$'TV7S$-:F1;=A([X1)3D"H@4H6; M(!+*2R3+V+/)"F?7VMT418A_[ZYM$FAYZ"-$5C1[YK(SYWCLNBYT.MV5XKR0 M?K_3\\NBWRV+E+*$\DYF3=<,?J8;"$+]1.$@"H80#(>'>[[OPZNXD:`PR12$ M!Q#THT$0'0SJ./?MSYSA(/2.`JB.`!8I'CI%(E4J%)Q"+S[9@06R+6102L`F M&5.%37(/1LGT<A9?>=#6T0Y\@YZC@_:1Y3JNZ\+H?#R+P>V^!>/)^=7?H,%& M-6@][7T!2]]DHQ",P^DI7/X8__H>F]J690E4:\&@=U*%82&Q,E[PH.K^V?SM M(@&>ZP'4IL0<"5"FP'8I)\P!6Q\\R):I`-<S'J>95C.B:%;%$DVR/54"TU6B MP*VMEZ3[-:GRX'&)`FM3$^=5_9H[@'*GTLOP?@C:\C\P[_`?Q.]38FB\G%R/ M)[/I[?7U.[E;GP-U:8N40G-#;*ER'>9!ZRX5C+)%!#'/'H"7*#3CG`'C"N2Z M++E0F,]9RSEYHW&C_;-I9#O*[CXSC_%_]#?BO<T,#X^]\'BPW<VF2TL/6!B. MU!(AQ]\T0]`\/0JJ4#;Z&?97/$=#_B2YN;B[@7:[RDITACU;4NF?D=PQ<I@^ MLH)+W,$52_HS@C76G.LU7,E%\Q+(1L(:]&I9K%;U(0)2\++<1"\-SEM?Y;QU MOY:;.8M:'M05+.WUSUBZPN:*1I3Q;1SOE+*:H24J78ZDZT)!F0J=I5!(S2@! MAEJX_-7PNK#SU'1M-*0J62!?;4?T3&,><$$7266U:X]1U6DR_V7%[&UXU->J 3#+>;^_E5@<\NRQ]WJFDT.0<``$?T ` end
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610252103.OAA13997>