mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
OpenZFS restructuring - zpool
Factor Linux specific functions out of the zpool command.
Reviewed-by: Allan Jude <allanjude@freebsd.org>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Sean Eric Fagan <sef@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9333
This commit is contained in:
committed by
Brian Behlendorf
parent
7bb0c29468
commit
3283f137d7
@@ -23,10 +23,25 @@
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <libzutil.h>
|
||||
|
||||
/*
|
||||
* Return B_TRUE if "str" is a number string, B_FALSE otherwise.
|
||||
* Works for integer and floating point numbers.
|
||||
*/
|
||||
boolean_t
|
||||
zfs_isnumber(const char *str)
|
||||
{
|
||||
for (; *str; str++)
|
||||
if (!(isdigit(*str) || (*str == '.')))
|
||||
return (B_FALSE);
|
||||
|
||||
return (B_TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a number to an appropriately human-readable output.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user