summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorRuediger Meier2016-02-29 12:38:58 +0100
committerKarel Zak2016-03-07 15:33:56 +0100
commit2208b3ccb298be2675cf005b761b1668f8cd576f (patch)
tree2321d7e68e87a87be24220824a47453f67a3881a /misc-utils
parenttaskset: fix description of `-c` option in the man page (diff)
downloadkernel-qcow2-util-linux-2208b3ccb298be2675cf005b761b1668f8cd576f.tar.gz
kernel-qcow2-util-linux-2208b3ccb298be2675cf005b761b1668f8cd576f.tar.xz
kernel-qcow2-util-linux-2208b3ccb298be2675cf005b761b1668f8cd576f.zip
lib: remove openat fallback functions (include/at.h)
I have validated that we are still compatible at least back to - openSUSE 11.4 - SLE 11 - RHEL/CentOS 6 - OSX 10.10.x, (Xcode 6.3) - FreeBSD 10.2 Confirmed incompatibility: - OSX 10.9.x, (Xcode 6.2) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/lsblk.c11
-rw-r--r--misc-utils/lslocks.c6
2 files changed, 5 insertions, 12 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
index 5c065a903..c9a39b36e 100644
--- a/misc-utils/lsblk.c
+++ b/misc-utils/lsblk.c
@@ -56,7 +56,6 @@
#include "nls.h"
#include "xalloc.h"
#include "strutils.h"
-#include "at.h"
#include "sysfs.h"
#include "closestream.h"
#include "mangle.h"
@@ -1320,15 +1319,14 @@ static int list_partitions(struct blkdev_cxt *wholedisk_cxt, struct blkdev_cxt *
return r;
}
-static int get_wholedisk_from_partition_dirent(DIR *dir, const char *dirname,
+static int get_wholedisk_from_partition_dirent(DIR *dir,
struct dirent *d, struct blkdev_cxt *cxt)
{
char path[PATH_MAX];
char *p;
int len;
- if ((len = readlink_at(dirfd(dir), dirname,
- d->d_name, path, sizeof(path) - 1)) < 0)
+ if ((len = readlinkat(dirfd(dir), d->d_name, path, sizeof(path) - 1)) < 0)
return 0;
path[len] = '\0';
@@ -1355,7 +1353,6 @@ static int list_deps(struct blkdev_cxt *cxt)
DIR *dir;
struct dirent *d;
struct blkdev_cxt dep = { 0 };
- char dirname[PATH_MAX];
const char *depname;
assert(cxt);
@@ -1375,12 +1372,10 @@ static int list_deps(struct blkdev_cxt *cxt)
DBG(CXT, ul_debugobj(cxt, "%s: checking for '%s' dependence", cxt->name, depname));
- snprintf(dirname, sizeof(dirname), "%s/%s", cxt->sysfs.dir_path, depname);
-
while ((d = xreaddir(dir))) {
/* Is the dependency a partition? */
if (sysfs_is_partition_dirent(dir, d, NULL)) {
- if (!get_wholedisk_from_partition_dirent(dir, dirname, d, &dep)) {
+ if (!get_wholedisk_from_partition_dirent(dir, d, &dep)) {
DBG(CXT, ul_debugobj(cxt, "%s: %s: dependence is partition",
cxt->name, d->d_name));
process_blkdev(&dep, cxt, 1, d->d_name);
diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c
index 389a3e42f..a47c1d0ad 100644
--- a/misc-utils/lslocks.c
+++ b/misc-utils/lslocks.c
@@ -39,7 +39,6 @@
#include "canonicalize.h"
#include "nls.h"
#include "xalloc.h"
-#include "at.h"
#include "strutils.h"
#include "c.h"
#include "list.h"
@@ -180,12 +179,11 @@ static char *get_filename_sz(ino_t inode, pid_t lock_pid, size_t *size)
if (!strtol(dp->d_name, (char **) NULL, 10))
continue;
- if (!fstat_at(fd, path, dp->d_name, &sb, 0)
+ if (!fstatat(fd, dp->d_name, &sb, 0)
&& inode != sb.st_ino)
continue;
- if ((len = readlink_at(fd, path, dp->d_name,
- sym, sizeof(sym) - 1)) < 1)
+ if ((len = readlinkat(fd, dp->d_name, sym, sizeof(sym) - 1)) < 1)
goto out;
*size = sb.st_size;