Commit 4ab8c0c4 authored by Andreas Henriksson's avatar Andreas Henriksson

New upstream version 2.32.1

parents 9c6704e9 2a1dd341
......@@ -275,6 +275,7 @@ CONTRIBUTORS:
Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Goffredo Baroncelli <kreijack@inwind.it>
Grady Martin <admin@nosuck.org>
G.raud Meyer <graud@gmx.com>
Guan Xin <guanx.bac@gmail.com>
Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Guillem Jover <guillem@hadrons.org>
......@@ -389,6 +390,7 @@ CONTRIBUTORS:
Luca Ceresoli <luca@lucaceresoli.net>
Luciano Chavez <lnx1138@us.ibm.com>
Ludwig Nussel <ludwig.nussel@suse.de>
Luiz Angelo Daros de Luca <luizluca@gmail.com>
Lukas Czerner <lczerner@redhat.com>
Makoto Kato <makoto.kt@gmail.com>
Mamatha Inamdar <mamatha4@linux.vnet.ibm.com>
......@@ -469,6 +471,7 @@ CONTRIBUTORS:
Olivier Mengué <dolmen@cpan.org>
Ondrej Oprala <ooprala@redhat.com>
Osamu Aoki <osamu@debian.org>
osexp2000 <osexp2000@gmail.com>
Pádraig Brady <P@draigBrady.com>
Pali Rohár <pali.rohar@gmail.com>
Pascal Terjan <pterjan@mandriva.com>
......@@ -524,6 +527,7 @@ CONTRIBUTORS:
Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Raul Gutierrez Segales <rgs@itevenworks.net>
Ray Wang <wanglei1123@gmail.com>
Richard Fuchs <rfuchs@sipwise.com>
Richard Tollerton <rich.tollerton@ni.com>
Richard Weinberger <richard@nod.at>
Richard W.M. Jones <rjones@redhat.com>
......@@ -657,6 +661,7 @@ CONTRIBUTORS:
Wylmer Wang <wantinghard@gmail.com>
W.Z. Venema
Yann Droneaud <yann@droneaud.fr>
YmrDtnJu <YmrDtnJu@users.noreply.github.com>
Yoshihiro Takahashi <ytakahashi@miraclelinux.com>
Yuri Chornoivan <yurchor@gmail.com>
Yuriy M. Kaminskiy <yumkam@gmail.com>
......
See version control history.
http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=log;h=2.32
http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=log;h=2.32.1
util-linux 2.32.1 Release Notes
===============================
agetty:
- keep c_iflags unmodified on --autologin [Karel Zak]
blkid:
- (man) add note about udev encoding [Karel Zak]
blkzone:
- fix whole device detection [Karel Zak]
bugfix:
- fix possible segfault during umount -a [Richard Fuchs]
build-sys:
- extend "Could not locate the pkg-config" error message [Karel Zak]
- improve bison version detection [Karel Zak]
cfdisk:
- fix compiler warnings, follow-up 7085f1e4 (#636) [Ruediger Meier]
- fix missing prototype for `get_wch` [Patrick Steinhardt]
- use uint64_t to avoid compiler warnings [Karel Zak]
chcpu:
- Fix maximal number of CPUs [Stanislav Brabec]
column:
- fix leading space characters bug [Karel Zak]
dmesg:
- fix raw output [Karel Zak]
- link together with syslog(2) manual page [Sami Kerola]
docs:
- update AUTHORS file [Karel Zak]
exec_shell:
- prevent ". applet not found" error when SHELL env is not set. [osexp2000]
fdisk:
- fix compiler warning [-Wmaybe-uninitialized] [Karel Zak]
fstrim:
- Return EXIT_FAILURE when FTRIM ioctl fails [Karel Zak]
- cleanup includes [Karel Zak]
lib/strutils:
- fix strnlen() fallback [Karel Zak]
libblkid:
- (hfs) check allocation size [Karel Zak]
- (ntfs) enlarge cluster limit to 2MB [Karel Zak, Jean-Pierre André]
- (ntfs) fix cluster size check [Karel Zak]
- (zfs) fix compiler warning [-Wmaybe-uninitialized] [Karel Zak]
- udf Fix reporting UDF 2.60 revision [Pali Rohár]
libfdisk:
- (docs) fix section name [Karel Zak]
- fix compiler warning [-Wunused-parameter] [Karel Zak]
- fix list_del after partition reset [Vaclav Dolezal]
- use \x<hex> to read/write partition name [Karel Zak]
libmount:
- fix compiler warning [-Wunused-parameter] [Karel Zak]
- fix mnt_table_is_fs_mounted() for NFS bind mounts. [NeilBrown]
- improve docs about mnt_context_mount() return codes [Karel Zak]
- include sys/mount.h on Linux only [Karel Zak]
- include sys/mount.h only if necessary [Karel Zak]
libsmartcols:
- don't print empty column [Karel Zak]
logger:
- Define SD_JOURNAL_SUPPRESS_LOCATION. [YmrDtnJu]
lsblk:
- don't exclude RAM disks on --all [Karel Zak]
- fix notes about RAM disks [Karel Zak]
lscpu, chcpu:
- Avoid use of the old CPU macros [Stanislav Brabec]
lslocks:
- add info about OFD [Karel Zak]
- fix memory leak [Karel Zak]
lslogins:
- fix password verification [Karel Zak]
partx:
- exit with error code when partition read failed [Andreas Henriksson]
po:
- fix lsblk translation [Karel Zak]
- merge changes [Karel Zak]
- pt_BR fix fallocate '-l' help msg [Luiz Angelo Daros de Luca]
- update ja.po (from translationproject.org) [Takeshi Hamasaki]
- update pt_BR.po (from translationproject.org) [Rafael Fontenelle]
rename:
- consolidate printing the symlink in addition to its target [G.raud Meyer]
- fix/reverse the semantics of --no-overwrite in --symlink mode [G.raud Meyer]
rfkill:
- include <poll.h> instead of <sys/poll.h> [Patrick Steinhardt]
setarch:
- add another PER_LINUX32 aliases for ppcle [Karel Zak]
tests:
- update column(1) space-separator test [Karel Zak]
umount:
- add note about --lazy [Karel Zak]
zramctl:
- (man) explain that --find is necessary [Karel Zak]
- (man) explain that --find is necessary [Karel Zak]
util-linux 2.32.1: Jul 16 2018
* see Documentation/releases/v2.32-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.32/v2.32.1-ChangeLog
util-linux 2.32: Mar 21 2018
* see Documentation/releases/v2.32-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.32/v2.32-ChangeLog
......
......@@ -73,7 +73,7 @@ if ! (bison --version) < /dev/null > /dev/null 2>&1; then
echo
DIE=1
else
lexver=$(bison --version | awk '/bison \(GNU Bison\)/ { print $4 }')
lexver=$(bison --version | awk '/^bison \(GNU [Bb]ison\)/ { print $4 }')
case "$lexver" in
[2-9].*)
;;
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for util-linux 2.32.
# Generated by GNU Autoconf 2.69 for util-linux 2.32.1.
#
# Report bugs to <kzak@redhat.com>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='util-linux'
PACKAGE_TARNAME='util-linux'
PACKAGE_VERSION='2.32'
PACKAGE_STRING='util-linux 2.32'
PACKAGE_VERSION='2.32.1'
PACKAGE_STRING='util-linux 2.32.1'
PACKAGE_BUGREPORT='kzak@redhat.com'
PACKAGE_URL='http://www.kernel.org/pub/linux/utils/util-linux/'
......@@ -1907,7 +1907,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures util-linux 2.32 to adapt to many kinds of systems.
\`configure' configures util-linux 2.32.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1977,7 +1977,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of util-linux 2.32:";;
short | recursive ) echo "Configuration of util-linux 2.32.1:";;
esac
cat <<\_ACEOF
......@@ -2290,7 +2290,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
util-linux configure 2.32
util-linux configure 2.32.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2816,7 +2816,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by util-linux $as_me 2.32, which was
It was created by util-linux $as_me 2.32.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -5055,7 +5055,7 @@ fi
# Define the identity of the package.
PACKAGE='util-linux'
VERSION='2.32'
VERSION='2.32.1'
cat >>confdefs.h <<_ACEOF
......@@ -5583,7 +5583,7 @@ PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{
sub("-.*","",$3); print $3 ~ /^[0-9]+$/ ? $3 : 0}')
LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
LIBBLKID_DATE="21-Mar-2018"
LIBBLKID_DATE="16-Jul-2018"
LIBBLKID_LT_MAJOR=1
LIBBLKID_LT_MINOR=1
LIBBLKID_LT_MICRO=0
......@@ -32922,7 +32922,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by util-linux $as_me 2.32, which was
This file was extended by util-linux $as_me 2.32.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -32989,7 +32989,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
util-linux config.status 2.32
util-linux config.status 2.32.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -29,7 +29,7 @@ PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{
dnl libblkid version
LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
LIBBLKID_DATE="21-Mar-2018"
LIBBLKID_DATE="16-Jul-2018"
LIBBLKID_LT_MAJOR=1
LIBBLKID_LT_MINOR=1
LIBBLKID_LT_MICRO=0
......@@ -164,7 +164,7 @@ m4_ifndef([PKG_PROG_PKG_CONFIG],
macros. These are usually located in /usr/share/aclocal/pkg.m4.
If your macros are in a different location, try setting the
environment variable AL_OPTS="-I/other/macro/dir" before running
./autogen.sh or autoreconf again.])])
./autogen.sh or autoreconf again. Make sure pkg-config is installed.])])
PKG_PROG_PKG_CONFIG
GTK_DOC_CHECK([1.10])
......
......@@ -33,6 +33,10 @@
# include <slang/slang.h>
#endif
#ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 500 /* for inclusion of get_wch */
#endif
#ifdef HAVE_SLCURSES_H
# include <slcurses.h>
#elif defined(HAVE_SLANG_SLCURSES_H)
......@@ -143,8 +147,8 @@ static void ui_draw_menu(struct cfdisk *cf);
static int ui_menu_move(struct cfdisk *cf, int key);
static void ui_menu_resize(struct cfdisk *cf);
static int ui_get_size(struct cfdisk *cf, const char *prompt, uintmax_t *res,
uintmax_t low, uintmax_t up, int *expsize);
static int ui_get_size(struct cfdisk *cf, const char *prompt, uint64_t *res,
uint64_t low, uint64_t up, int *expsize);
static int ui_enabled;
static volatile sig_atomic_t sig_resize;
......@@ -1707,7 +1711,7 @@ static int ui_refresh(struct cfdisk *cf)
attron(A_BOLD);
ui_center(0, _("Disk: %s"), fdisk_get_devname(cf->cxt));
attroff(A_BOLD);
ui_center(1, _("Size: %s, %ju bytes, %ju sectors"),
ui_center(1, _("Size: %s, %"PRIu64" bytes, %ju sectors"),
strsz, bytes, (uintmax_t) fdisk_get_nsectors(cf->cxt));
if (fdisk_get_disklabel_id(cf->cxt, &id) == 0 && id)
ui_center(2, _("Label: %s, identifier: %s"),
......@@ -1843,17 +1847,17 @@ done:
static int ui_get_size(struct cfdisk *cf, /* context */
const char *prompt, /* UI dialog string */
uintmax_t *res, /* result in bytes */
uintmax_t low, /* minimal size */
uintmax_t up, /* maximal size */
uint64_t *res, /* result in bytes */
uint64_t low, /* minimal size */
uint64_t up, /* maximal size */
int *expsize) /* explicitly specified size */
{
char buf[128];
uintmax_t user = 0;
uint64_t user = 0;
ssize_t rc;
char *dflt = size_to_human_string(0, *res);
DBG(UI, ul_debug("get_size (default=%ju)", *res));
DBG(UI, ul_debug("get_size (default=%"PRIu64")", *res));
ui_clean_info();
......@@ -1882,16 +1886,16 @@ static int ui_get_size(struct cfdisk *cf, /* context */
insec = 1;
buf[len - 1] = '\0';
}
rc = parse_size(buf, &user, &pwr); /* parse */
rc = parse_size(buf, (uintmax_t *)&user, &pwr); /* parse */
}
if (rc == 0) {
DBG(UI, ul_debug("get_size user=%ju, power=%d, in-sectors=%s",
DBG(UI, ul_debug("get_size user=%"PRIu64", power=%d, in-sectors=%s",
user, pwr, insec ? "yes" : "no"));
if (insec)
user *= fdisk_get_sector_size(cf->cxt);
if (user < low) {
ui_warnx(_("Minimum size is %ju bytes."), low);
ui_warnx(_("Minimum size is %"PRIu64" bytes."), low);
rc = -ERANGE;
}
if (user > up && pwr && user < up + (1ULL << pwr * 10))
......@@ -1900,7 +1904,7 @@ static int ui_get_size(struct cfdisk *cf, /* context */
user = up;
if (user > up) {
ui_warnx(_("Maximum size is %ju bytes."), up);
ui_warnx(_("Maximum size is %"PRIu64" bytes."), up);
rc = -ERANGE;
}
if (rc == 0 && insec && expsize)
......@@ -1914,7 +1918,7 @@ static int ui_get_size(struct cfdisk *cf, /* context */
*res = user;
free(dflt);
DBG(UI, ul_debug("get_size (result=%ju, rc=%zd)", *res, rc));
DBG(UI, ul_debug("get_size (result=%"PRIu64", rc=%zd)", *res, rc));
return rc;
}
......
......@@ -271,7 +271,7 @@ static int ask_number(struct fdisk_context *cxt,
do {
int rc = get_user_reply(prompt, buf, bufsz);
uint64_t num;
uint64_t num = 0;
if (rc)
return rc;
......
......@@ -1047,7 +1047,9 @@ int main(int argc, char **argv)
default:
abort();
}
}
} else
rc = 1;
blkid_free_probe(pr);
}
......
......@@ -33,13 +33,14 @@
void __attribute__((__noreturn__)) exec_shell(void)
{
const char *shell = getenv("SHELL");
char *shellc = xstrdup(shell);
char *shellc;
const char *shell_basename;
char *arg0;
if (!shell)
shell = DEFAULT_SHELL;
shellc = xstrdup(shell);
shell_basename = basename(shellc);
arg0 = xmalloc(strlen(shell_basename) + 2);
arg0[0] = '-';
......
......@@ -243,11 +243,11 @@ void *mempcpy(void *restrict dest, const void *restrict src, size_t n)
#ifndef HAVE_STRNLEN
size_t strnlen(const char *s, size_t maxlen)
{
int i;
size_t i;
for (i = 0; i < maxlen; i++) {
if (s[i] == '\0')
return i + 1;
return i;
}
return maxlen;
}
......
......@@ -25,6 +25,8 @@ struct hfs_finder_info {
uint8_t id[8];
} __attribute__((packed));
#define HFS_SECTOR_SIZE 512
struct hfs_mdb {
uint8_t signature[2];
uint32_t cr_date;
......@@ -153,6 +155,7 @@ static int hfs_set_uuid(blkid_probe pr, unsigned char const *hfs_info, size_t le
static int probe_hfs(blkid_probe pr, const struct blkid_idmag *mag)
{
struct hfs_mdb *hfs;
int size;
hfs = blkid_probe_get_sb(pr, mag, struct hfs_mdb);
if (!hfs)
......@@ -162,6 +165,12 @@ static int probe_hfs(blkid_probe pr, const struct blkid_idmag *mag)
(memcmp(hfs->embed_sig, "HX", 2) == 0))
return 1; /* Not hfs, but an embedded HFS+ */
size = be32_to_cpu(hfs->al_blk_size);
if (!size || (size & (HFS_SECTOR_SIZE - 1))) {
DBG(LOWPROBE, ul_debug("\tbad allocation size - ignore"));
return 1;
}
hfs_set_uuid(pr, hfs->finder_info.id, sizeof(hfs->finder_info.id));
blkid_probe_set_label(pr, hfs->label, hfs->label_len);
......
......@@ -72,7 +72,8 @@ struct file_attribute {
} __attribute__((__packed__));
#define MFT_RECORD_VOLUME 3
#define NTFS_MAX_CLUSTER_SIZE (64 * 1024)
/* Windows 10 Creators edition has extended the cluster size limit to 2MB */
#define NTFS_MAX_CLUSTER_SIZE (2 * 1024 * 1024)
enum {
MFT_RECORD_ATTR_VOLUME_NAME = 0x60,
......@@ -97,20 +98,23 @@ static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag)
* Check bios parameters block
*/
sector_size = le16_to_cpu(ns->bpb.sector_size);
sectors_per_cluster = ns->bpb.sectors_per_cluster;
if (sector_size < 256 || sector_size > 4096)
return 1;
switch (sectors_per_cluster) {
switch (ns->bpb.sectors_per_cluster) {
case 1: case 2: case 4: case 8: case 16: case 32: case 64: case 128:
sectors_per_cluster = ns->bpb.sectors_per_cluster;
break;
default:
return 1;
if ((ns->bpb.sectors_per_cluster < 240)
|| (ns->bpb.sectors_per_cluster > 249))
return 1;
sectors_per_cluster = 1 << (256 - ns->bpb.sectors_per_cluster);
}
if ((uint16_t) le16_to_cpu(ns->bpb.sector_size) *
ns->bpb.sectors_per_cluster > NTFS_MAX_CLUSTER_SIZE)
sectors_per_cluster > NTFS_MAX_CLUSTER_SIZE)
return 1;
/* Unused fields must be zero */
......
......@@ -446,6 +446,16 @@ real_blksz:
lvidiu_udf_rev = le16_to_cpu(lvidiu->min_udf_read_rev);
if (lvidiu_udf_rev)
udf_rev = lvidiu_udf_rev;
/* UDF-2.60: 2. Basic Restrictions & Requirements:
* The Minimum UDF Read Revision value shall be at most #0250
* for all media with a UDF 2.60 file system.
* So in this case use Minimum UDF Write Revision as ID_FS_VERSION
* to distinguish between UDF 2.50 and UDF 2.60 discs. */
if (lvidiu_udf_rev == 0x250) {
lvidiu_udf_rev = le16_to_cpu(lvidiu->min_udf_write_rev);
if (lvidiu_udf_rev > 0x250)
udf_rev = lvidiu_udf_rev;
}
}
}
......
......@@ -219,7 +219,7 @@ static int probe_zfs(blkid_probe pr,
{
int swab_endian = 0;
struct zfs_uberblock *ub;
loff_t offset, ub_offset = 0;
loff_t offset = 0, ub_offset = 0;
int label_no, found = 0, found_in_label;
void *label;
loff_t blk_align = (pr->size % (256 * 1024ULL));
......
......@@ -1028,13 +1028,11 @@ static const struct fdisk_field bsd_fields[] =
/*
* allocates BSD label driver
*/
struct fdisk_label *fdisk_new_bsd_label(struct fdisk_context *cxt)
struct fdisk_label *fdisk_new_bsd_label(struct fdisk_context *cxt __attribute__ ((__unused__)))
{
struct fdisk_label *lb;
struct fdisk_bsd_label *bsd;
assert(cxt);
bsd = calloc(1, sizeof(*bsd));
if (!bsd)
return NULL;
......
......@@ -20,7 +20,7 @@
/**
* SECTION: dos
* @title: DOS (MBR)
* @title: DOS
* @short_description: disk label specific functions
*
*/
......@@ -2464,13 +2464,11 @@ static const struct fdisk_label_operations dos_operations =
/*
* allocates DOS in-memory stuff
*/
struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt)
struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt __attribute__ ((__unused__)))
{
struct fdisk_label *lb;
struct fdisk_dos_label *dos;
assert(cxt);
dos = calloc(1, sizeof(*dos));
if (!dos)
return NULL;
......
......@@ -3140,13 +3140,11 @@ static const struct fdisk_field gpt_fields[] =
/*
* allocates GPT in-memory stuff
*/
struct fdisk_label *fdisk_new_gpt_label(struct fdisk_context *cxt)
struct fdisk_label *fdisk_new_gpt_label(struct fdisk_context *cxt __attribute__ ((__unused__)))
{
struct fdisk_label *lb;
struct fdisk_gpt_label *gpt;
assert(cxt);
gpt = calloc(1, sizeof(*gpt));
if (!gpt)
return NULL;
......
......@@ -130,8 +130,8 @@ void fdisk_unref_partition(struct fdisk_partition *pa)
pa->refcount--;
if (pa->refcount <= 0) {
fdisk_reset_partition(pa);
list_del(&pa->parts);
fdisk_reset_partition(pa);
DBG(PART, ul_debugobj(pa, "free"));
free(pa);
}
......
......@@ -2,6 +2,7 @@
#include "fdiskP.h"
#include "strutils.h"
#include "carefulputc.h"
#include "mangle.h"
/**
* SECTION: script
......@@ -650,8 +651,10 @@ static int write_file_sfdisk(struct fdisk_script *dp, FILE *f)
if (pa->uuid)
fprintf(f, ", uuid=%s", pa->uuid);
if (pa->name && *pa->name)
fprintf(f, ", name=\"%s\"", pa->name);
if (pa->name && *pa->name) {
fputs(", name=", f);
fputs_quoted(pa->name, f);
}
/* for MBR attr=80 means bootable */
if (pa->attrs) {
......@@ -948,6 +951,7 @@ static int parse_line_nameval(struct fdisk_script *dp, char *s)
} else if (!strncasecmp(p, "name=", 5)) {
p += 5;
rc = next_string(&p, &pa->name);
unhexmangle_string(pa->name);
} else if (!strncasecmp(p, "type=", 5) ||
!strncasecmp(p, "Id=", 3)) { /* backward compatibility */
......
......@@ -1178,13 +1178,11 @@ static const struct fdisk_label_operations sgi_operations =
};
/* Allocates an SGI label driver. */
struct fdisk_label *fdisk_new_sgi_label(struct fdisk_context *cxt)
struct fdisk_label *fdisk_new_sgi_label(struct fdisk_context *cxt __attribute__ ((__unused__)))
{
struct fdisk_label *lb;
struct fdisk_sgi_label *sgi;
assert(cxt);
sgi = calloc(1, sizeof(*sgi));
if (!sgi)
return NULL;
......
......@@ -1149,13 +1149,11 @@ static const struct fdisk_label_operations sun_operations =
/*
* allocates SUN label driver
*/
struct fdisk_label *fdisk_new_sun_label(struct fdisk_context *cxt)
struct fdisk_label *fdisk_new_sun_label(struct fdisk_context *cxt __attribute__ ((__unused__)))
{
struct fdisk_label *lb;
struct fdisk_sun_label *sun;
assert(cxt);
sun = calloc(1, sizeof(*sun));
if (!sun)
return NULL;
......
......@@ -961,8 +961,9 @@ int mnt_context_prepare_mount(struct libmnt_context *cxt)
* WARNING: non-zero return code does not mean that mount(2) syscall or
* mount.type helper wasn't successfully called.
*
* Check mnt_context_get_status() after error!
*
* Check mnt_context_get_status() after error! See mnt_context_mount() for more
* details about errors and warnings.
*
* Returns: 0 on success;
* >0 in case of mount(2) error (returns syscall errno),
* <0 in case of other errors.
......@@ -1086,7 +1087,32 @@ int mnt_context_finalize_mount(struct libmnt_context *cxt)
* WARNING: non-zero return code does not mean that mount(2) syscall or
* mount.type helper wasn't successfully called.
*
* Check mnt_context_get_status() after error!
* Always use mnt_context_get_status():
*
* <informalexample>
* <programlisting>
* rc = mnt_context_mount(cxt);
*
* if (mnt_context_helper_executed(cxt))
* return mnt_context_get_helper_status(cxt);
* if (rc == 0 && mnt_context_get_status(cxt) == 1)
* return MNT_EX_SUCCESS;
* return MNT_EX_FAIL;
* </programlisting>
* </informalexample>
*
* or mnt_context_get_excode() to generate mount(8) compatible error
* or warning message:
*
* <informalexample>
* <programlisting>
* rc = mnt_context_mount(cxt);
* rc = mnt_context_get_excode(cxt, rc, buf, sizeof(buf));
* if (buf)
* warnx(_("%s: %s"), mnt_context_get_target(cxt), buf);
* return rc; // MNT_EX_*
* </programlisting>
* </informalexample>
*
* Returns: 0 on success;
* >0 in case of mount(2) error (returns syscall errno),
......@@ -1163,6 +1189,8 @@ again:
* Use also mnt_context_get_status() to check if the filesystem was
* successfully mounted.
*
* See mnt_context_mount() for more details about errors and warnings.
*
* Returns: 0 on success,
* <0 in case of error (!= mount(2) errors)
* 1 at the end of the list.
......
......@@ -1003,11 +1003,12 @@ int mnt_context_next_umount(struct libmnt_context *cxt,
rc = mnt_context_get_mtab(cxt, &mtab);
cxt->mtab = NULL; /* do not reset mtab */
mnt_reset_context(cxt);