commit - 028b45472c17163713361d1542d5761dc497a882
commit + aff15c23653b4bbae656ed3075a7132b92107f73
blob - 8fb317674c632c7d9550027704a3baba871197e9
blob + d29e2121ecc02ed4606a1878eb0713e7be9d965a
--- Makefile
+++ Makefile
# See LICENSE file for copyright and license details.
.POSIX:
-VERSION = 0.1.6
+VERSION = 1.0
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/man
-CFLAGS = -pipe -O2 -Wall -Werror
+MY_CFLAGS = -Wall -Wextra -Werror -pedantic -std=c99 -DVERSION=\"${VERSION}\" ${CFLAGS}
all: lsblk
lsblk: lsblk.c
- ${CC} -o $@ $< ${CFLAGS} -DVERSION=\"${VERSION}\"
+ ${CC} -o lsblk lsblk.c ${MY_CFLAGS}
clean:
rm -f lsblk
sed "s/@VERSION@/${VERSION}/" lsblk.8 > ${DESTDIR}${MANPREFIX}/man8/lsblk.8
uninstall:
- rm -f $(DESTDIR)$(PREFIX)/sbin/lsblk
+ rm -f ${DESTDIR}${PREFIX}/sbin/lsblk ${DESTDIR}${MANPREFIX}/man8/lsblk.8
blob - fa8e61548c860b22af1026a9c8686f348fe96d70
blob + 6a3a8644b63bd2bb87b113f059ae3d9ea066e81d
--- lsblk.8
+++ lsblk.8
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.TH LSBLK 8 lsblk-@VERSION@ 2023-04-09
+.TH LSBLK 8 lsblk-@VERSION@ 2023-04-30
.SH NAME
lsblk \- list block devices
.SH SYNOPSIS
.SH OPTIONS
.TP
.B \-V
-prints version information to stderr, then exits.
+prints version information to stdout, then exits.
.SH SEE ALSO
.BR disklabel (8)
blob - 789cb65c34c33eacce9fa2cedf01326eb1bc43b0
blob + 3eb48fb293a0c290a2740bc72a2bfc3fcb0b42a4
--- lsblk.c
+++ lsblk.c
int main (int argc, char *argv[])
{
+ if (unveil ("/dev", "r") == -1)
+ die ("unveil(/dev)");
+
+ if (unveil (NULL, NULL) == -1)
+ die ("unveil()");
+
int option;
while ((option = getopt (argc, argv, ":V")) != -1) {
switch (option) {