History log of /freebsd-current/usr.sbin/fdread/fdread.c
Revision Date Author Comments
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 049e1954 03-May-2017 Marcelo Araujo <araujo@FreeBSD.org>

Free the memory allocated to trackbuf before exiting, it might fix a potential
memory leak.

Submitted by: trix@juniper.net
MFC after: 2 weeks.
Differential Revision: https://reviews.freebsd.org/D9856


# 45be165f 13-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use NULL instead of 0 for pointers.

The strchr(3) returns a NULL if the character does not appears in the string.
The malloc will return NULL if cannot allocate memory.


# d938340a 06-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Mark global functions and/or variables in fdread(8) static where possible.

This allows compilers and static analyzers to do more thorough analysis.


# beee0062 17-Jun-2011 Joerg Wunsch <joerg@FreeBSD.org>

Open the floppy disk device with O_RDONLY rather than O_RDWR. After
all, this is the fd*read* command, and thus should be able to read
even write-protected disks.

MFC after: 1 week


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 81f5cd99 24-Jun-2009 Joerg Wunsch <joerg@FreeBSD.org>

Drop the defunct FDOPT_NOERRLOG option from all the floppy utilities.
The kernel does not log floppy media errors anymore.

In fdcontrol, do always open the file descriptor in read-only mode so
it can operate on read-only media, as there is no longer a separate
control device to operate on.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 347a5ee7 20-Jul-2006 Stefan Farfeleder <stefanf@FreeBSD.org>

Remove unused variables.


# cb89fb11 26-Oct-2005 Peter Wemm <peter@FreeBSD.org>

fdread cannot work without opening the /dev/fd node in O_RDWR mode now,
because it sets the floppy controller parameters, which requires O_RDWR.
Specifically, the FD_SOPTS ioctl requires this, and the code errors out
and aborts if it can't do it. Among other things, it is changing the
FDOPT_NOERRLOG flag. Broken in 6.0 as well.


# 4c1f1c62 08-Jan-2005 Xin LI <delphij@FreeBSD.org>

Cleanup usr.sbin/fd* so they can compile under WARNS=6.

fdcontrol/fdcontrol.c:
- Add const constraint to an intermediate value
which is not supposed to be changed elsewhere.
fdread/fdread.c:
- Use _devname in favor of devname to avoid name
conflicit.
- -1 is less than any positive number so in order
to get the block to function, we should get the
block a little earlier.
- Cast to remove signed when we are sure that a
return value is positive, or is compared with
an positive number (tracknumber of a floppy
disk is not likely to have UINT_MAX/2 anyway)
fdread/fdutil.c:
- Use more specific initializer
fdwrite/fdwrite.c:
- Use static on format_track since it's not
referenced in other places.
- Use const char* to represent string constant.

Bump WARNS accordingly.


# 65217f13 02-Jul-2001 Joerg Wunsch <joerg@FreeBSD.org>

Break out the function to print the FDC error information into
fdutil.c so it can be used elsewhere.


# 8a5f4c12 26-Jun-2001 Joerg Wunsch <joerg@FreeBSD.org>

Implement the -I option that uses the FD_READID ioctl in order to read
sector ID fields from a floppy, and display them.


# d137c337 06-Jun-2001 Joerg Wunsch <joerg@FreeBSD.org>

Part #2 of the <machine/ioctl_fd.h> => <sys/fdcio.h> move: handle the
tools in usr.sbin/fd*.


# ba44060d 04-Jun-2001 Joerg Wunsch <joerg@FreeBSD.org>

Now that we've got the ne765.h file installed under <dev/ic/>, use it
here instead of the old "/sys/isa/ic/..." hack. This should fix
building the world for machines that don't have a /sys symlink,
finally.


# b97809a7 14-May-2001 Joerg Wunsch <joerg@FreeBSD.org>

Initial import of fdread(1), a logical counterpart to fdwrite(1).

Its main purpose is to adapt automatically to the floppy parameters
(in particular the track size for efficient reading), and to allow a
simple error recovery for CRC-errored sectors. Requires the newly
added fdc(4) options.