Page MenuHomeFreeBSD

D29917.1777634464.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D29917.1777634464.diff

Index: usr.sbin/fstyp/bfs.c
===================================================================
--- usr.sbin/fstyp/bfs.c
+++ usr.sbin/fstyp/bfs.c
@@ -1,11 +1,12 @@
-/*
+/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
- * Copyright (c) 2021 Miguel Gocobachi <miguel@gocobachi.dev>
+ * Copyright (c) 2021 Miguel Gocobachi
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
+ *
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@@ -23,7 +24,10 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * From: @(#)style 1.14 (Berkeley) 4/28/95
*/
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -34,7 +38,7 @@
#include "fstyp.h"
-#define BFS_OS_NAME_LENGTH 32
+#define BFS_OS_NAME_LENGTH 32
#define BFS_SUPER_BLOCK_MAGIC1 0x42465331
struct bfs_disk_superblock {
@@ -47,25 +51,23 @@
{
struct bfs_disk_superblock *volume;
- volume = read_buf(fp, 512, sizeof(*volume));
+ volume = (struct bfs_disk_superblock *) read_buf(fp, 512, sizeof(*volume));
if (volume == NULL) {
- free(volume);
-
return (1);
}
- if (volume->magic1 != BFS_SUPER_BLOCK_MAGIC1) {
+ if (volume->magic1 == BFS_SUPER_BLOCK_MAGIC1) {
+ bzero(label, size);
+ strlcpy(label, volume->name, MIN(size, BFS_OS_NAME_LENGTH));
+ rtrim(label, size);
+
free(volume);
- return (1);
+ return (0);
}
- bzero(label, size);
- strlcpy(label, volume->name, MIN(size, BFS_OS_NAME_LENGTH));
- rtrim(label, size);
-
free(volume);
- return (0);
+ return (1);
}
Index: usr.sbin/fstyp/fstyp.8
===================================================================
--- usr.sbin/fstyp/fstyp.8
+++ usr.sbin/fstyp/fstyp.8
@@ -42,7 +42,7 @@
The
.Nm
utility is used to determine the filesystem type on a given device.
-It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS filesystems.
+It can recognize BFS (BeOS), ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS filesystems.
When the
.Fl u
flag is specified,
@@ -59,6 +59,8 @@
as, respectively:
.Bl -item -offset indent -compact
.It
+bfs
+.It
cd9660
.It
exfat

File Metadata

Mime Type
text/plain
Expires
Fri, May 1, 11:21 AM (1 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28524110
Default Alt Text
D29917.1777634464.diff (2 KB)

Event Timeline