mirror of
https://github.com/troglobit/libite.git
synced 2026-10-13 10:14:42 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7df1b75fa0 | ||
|
|
9b1b7ca4cf | ||
|
|
1e064b8b4d | ||
|
|
18dde87f0a | ||
|
|
fcb38c9cc5 | ||
|
|
ab69ae8374 | ||
|
|
95f7a91a8a | ||
|
|
aab5a1145c | ||
|
|
fe1a3a731d | ||
|
|
cd073f5221 | ||
|
|
1a9d3bd91b | ||
|
|
8cc267f259 | ||
|
|
35d396ec27 | ||
|
|
7e91307138 | ||
|
|
2b8f54fbc7 | ||
|
|
2e58dd3203 | ||
|
|
41392f7e85 | ||
|
|
e4329d6c25 | ||
|
|
7113b3d1d8 | ||
|
|
9b6ef1f053 | ||
|
|
efc70e3a75 | ||
|
|
147df0c6da | ||
|
|
7f89000c6c | ||
|
|
7607148d46 | ||
|
|
979f76aea7 | ||
|
|
ac41fa70aa | ||
|
|
5f820b17b6 | ||
|
|
53b715c094 | ||
|
|
1b4cd7b20b | ||
|
|
8e379ca358 | ||
|
|
12241dcdfe | ||
|
|
0ce1b3bf44 | ||
|
|
38ff0af61a | ||
|
|
00737a5b74 | ||
|
|
1b8b164ed4 | ||
|
|
9f279c0fec | ||
|
|
4d7e6d4f78 | ||
|
|
0a57f2128f | ||
|
|
e254db48a8 | ||
|
|
0fe429dcbe | ||
|
|
f1a2e01775 | ||
|
|
e5eef2ae59 | ||
|
|
f9caffc9b7 | ||
|
|
604b503b84 | ||
|
|
5fc248522c | ||
|
|
c0b8bab164 | ||
|
|
c0e9c0431a |
No files matched your search
+7
-1
@@ -4,7 +4,13 @@ language: c
|
||||
|
||||
# Some of the autotests may use sudo, so use non-dockerized build atm.
|
||||
# http://stackoverflow.com/questions/26299552/travis-sudo-is-disabled
|
||||
sudo: true
|
||||
#sudo: true
|
||||
sudo: false
|
||||
|
||||
# Test build with both GCC and Clang (LLVM)
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
|
||||
# - make test
|
||||
script:
|
||||
|
||||
+88
-1
@@ -3,6 +3,85 @@ Change Log
|
||||
|
||||
All notable changes to the project are documented in this file.
|
||||
|
||||
[v1.6.0][] - 2016-05-13
|
||||
-----------------------
|
||||
|
||||
### Changes
|
||||
|
||||
- Add support for NetBSD `fparaseln()` for the benefit of [Mg][]
|
||||
- Add support for OpenBSD `reallocarray()` for the benefit of [Mg][]
|
||||
- Constify `fisdir()` argument
|
||||
|
||||
|
||||
[v1.5.1][] - 2016-04-17
|
||||
-----------------------
|
||||
|
||||
Minor fix release.
|
||||
|
||||
### Changes
|
||||
- Update README.md, add help when libite is used in autotools projects.
|
||||
Spell checking and minor cleanup.
|
||||
|
||||
### Fixes
|
||||
- Activate use of `utimensat()` when `pidfile()` is called multiple
|
||||
times. This reduces the overhead of calling open+write+close to
|
||||
simply updating the mtime of the PID file.
|
||||
- Westermo fixes for `fcopyfile()`: nothing copied on embedded PPC
|
||||
system when using `tmpfile()` as source.
|
||||
|
||||
|
||||
[v1.5.0][] - 2016-03-20
|
||||
-----------------------
|
||||
|
||||
This release changes the header file namespace. Apologies for any
|
||||
problems this may cause!
|
||||
|
||||
### Changes
|
||||
- Change namespace for header files: `libite/` to `lite/`, e.g. using
|
||||
`pkg-config` your C program must now `#include <lite/lite.h>`
|
||||
- Update `pidfile()` to use `utimensat()` to update atime+mtime instead
|
||||
of opening and writing PID again. Less overhead and nanonsecond res.
|
||||
|
||||
|
||||
[v1.4.4][] - 2016-02-23
|
||||
-----------------------
|
||||
|
||||
### Changes
|
||||
- Add `ibite.pc.in` for `pkg-config` support.
|
||||
|
||||
### Fixes
|
||||
- Fix issue #3: `tempfile()` fails with bad `O_TMPFILE` on some embedded
|
||||
targets, in particular PowerPC. On systems with older GLIBC but with
|
||||
a sufficiently new kernel `O_TMPFILE` is missing and the local libite
|
||||
definition was wrong, hard coded for x86. Fixed by Johan Askerin.
|
||||
|
||||
|
||||
[v1.4.3][] - 2016-02-02
|
||||
-----------------------
|
||||
|
||||
### Fixes
|
||||
- Remove symlinks to Markdown files from GIT
|
||||
- Distribute and install Markdown files: README.md, etc.
|
||||
|
||||
|
||||
[v1.4.2][] - 2016-01-23
|
||||
-----------------------
|
||||
|
||||
### Fixes
|
||||
- Fix issue #2: GCC6 `-Wmisleading-indentation` causing FTBFS in pimd,
|
||||
which enables `-Werror`
|
||||
|
||||
|
||||
[v1.4.1][] - 2016-01-22
|
||||
-----------------------
|
||||
|
||||
### Fixes
|
||||
- Fix install path for include files, regression in v1.4.0 With the
|
||||
introduction of GNU autotools include file namespace was unfortunately
|
||||
lost. All include files were therefore installed in $(prefix)/include
|
||||
instead of $(prefix)/include/libite.
|
||||
|
||||
|
||||
[v1.4.0][] - 2016-01-22
|
||||
-----------------------
|
||||
|
||||
@@ -85,7 +164,14 @@ All notable changes to the project are documented in this file.
|
||||
Initial extraction of frog DNA from [Finit][]. See [README][] for API details.
|
||||
|
||||
|
||||
[UNRELEASED]: https://github.com/troglobit/libite/compare/v1.4.0...HEAD
|
||||
[UNRELEASED]: https://github.com/troglobit/libite/compare/v1.6.0...HEAD
|
||||
[v1.6.0]: https://github.com/troglobit/libite/compare/v1.5.1...v1.6.0
|
||||
[v1.5.1]: https://github.com/troglobit/libite/compare/v1.5.0...v1.5.1
|
||||
[v1.5.0]: https://github.com/troglobit/libite/compare/v1.4.4...v1.5.0
|
||||
[v1.4.4]: https://github.com/troglobit/libite/compare/v1.4.3...v1.4.4
|
||||
[v1.4.3]: https://github.com/troglobit/libite/compare/v1.4.2...v1.4.3
|
||||
[v1.4.2]: https://github.com/troglobit/libite/compare/v1.4.1...v1.4.2
|
||||
[v1.4.1]: https://github.com/troglobit/libite/compare/v1.4.0...v1.4.1
|
||||
[v1.4.0]: https://github.com/troglobit/libite/compare/v1.3.0...v1.4.0
|
||||
[v1.3.0]: https://github.com/troglobit/libite/compare/v1.2.0...v1.3.0
|
||||
[v1.2.0]: https://github.com/troglobit/libite/compare/v1.1.1...v1.2.0
|
||||
@@ -93,6 +179,7 @@ Initial extraction of frog DNA from [Finit][]. See [README][] for API details.
|
||||
[v1.1.0]: https://github.com/troglobit/libite/compare/v1.0.0...v1.1.0
|
||||
[v1.0.0]: https://github.com/troglobit/libite/compare/TAIL...v1.0.0
|
||||
[Finit]: https://github.com/troglobit/finit/
|
||||
[Mg]: https://github.com/troglobit/mg
|
||||
[README]: https://github.com/troglobit/libite/blob/v1.0.0/README.md
|
||||
|
||||
<!--
|
||||
|
||||
+11
-7
@@ -1,17 +1,21 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
lib_LTLIBRARIES = libite.la
|
||||
include_HEADERS = lite.h queue.h conio.h tree.h
|
||||
libite_la_SOURCES = chomp.c copyfile.c dir.c fexist.c fisdir.c fmode.c fsendfile.c \
|
||||
ifconfig.c lfile.c makepath.c pidfile.c pidfilefn.c progress.c \
|
||||
rsync.c strlcpy.c strlcat.c strtonum.c tempfile.c tree.c
|
||||
pkgincludedir = $(includedir)/lite
|
||||
pkginclude_HEADERS = lite.h queue.h conio.h tree.h
|
||||
libite_la_SOURCES = chomp.c copyfile.c dir.c fexist.c fisdir.c fmode.c fparseln.c \
|
||||
fsendfile.c ifconfig.c lfile.c makepath.c pidfile.c pidfilefn.c \
|
||||
progress.c reallocarray.c rsync.c strlcpy.c strlcat.c strtonum.c \
|
||||
tempfile.c tree.c
|
||||
|
||||
libite_la_CPPFLAGS = -D_GNU_SOURCE
|
||||
libite_la_CFLAGS = -W -Wall -Wextra
|
||||
libite_la_LDFLAGS = $(AM_LDFLAGS) -version-info 2:1:0
|
||||
libite_la_LDFLAGS = $(AM_LDFLAGS) -version-info 2:2:0
|
||||
|
||||
doc_DATA = README LICENSE
|
||||
#EXTRA_DIST = README.md AUTHORS LICENSE ChangeLog.md
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libite.pc
|
||||
doc_DATA = README.md LICENSE
|
||||
EXTRA_DIST = README.md LICENSE ChangeLog.md
|
||||
|
||||
## Generate MD5 checksum file
|
||||
MD5 = md5sum
|
||||
|
||||
@@ -2,16 +2,32 @@
|
||||
===========================
|
||||
[![Travis Status][]][Travis]
|
||||
|
||||
|
||||
Table of Contents
|
||||
-----------------
|
||||
|
||||
* [Introduction](#introduction)
|
||||
* [Using -lite](#using--lite)
|
||||
* [Helper Macros](#helper-macros)
|
||||
* [Generic Functions](#generic-functions)
|
||||
* [OpenBSD Functions](#openbsd-functions)
|
||||
* [Build & Install](#origin--references)
|
||||
* [TODO](#todo)
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Libite is a lightweight library of *frog DNA*. It can be used to fill
|
||||
the gaps in any dinosaur project. It holds useful functions and macros
|
||||
developed by both [Finit][1] and the [OpenBSD][2] project. Most notably
|
||||
the string functions: [strlcpy(3)][3], [strlcat(3)][3] and the highly
|
||||
useful *BSD [sys/queue.h][4] and [sys/tree.h][7] API's.
|
||||
|
||||
Libite aims to fill in the gaps missing in GLIBC/EGLIBC. (It does not
|
||||
aimo to become another [GLIB][5] though.) One such gap in GLIBC is the
|
||||
missing `_SAFE` macros in `sys/queue.h` — highly recommended when
|
||||
traversing lists to delete/free nodes.
|
||||
Libite is the frog DNA missing in GNU libc. However, -lite does not aim
|
||||
to become another [GLIB][5]! One noticeable gap in GLIBC is the missing
|
||||
`_SAFE` macros in the BSD `sys/queue.h` API — highly recommended
|
||||
when traversing lists to delete/free nodes.
|
||||
|
||||
The code is open sourced under a mix of the [MIT/X11 license][MIT], the
|
||||
[ISC license][ISC] used by OpenBSD, and [BSD licenses][BSD], all of them
|
||||
@@ -22,6 +38,38 @@ For an introduction to why Libite happened, and how you can use it, see
|
||||
[this blog post][6].
|
||||
|
||||
|
||||
Using -lite
|
||||
-----------
|
||||
|
||||
Libite is by default installed as a library and a set of include files.
|
||||
To prevent clashing with include files of the same name `-lite` employs
|
||||
an include file namespace `lite/`, which is strongly recommended to use
|
||||
in your applications:
|
||||
|
||||
#include <lite/lite.h>
|
||||
#include <lite/conio.h>
|
||||
#include <lite/queue.h>
|
||||
#include <lite/tree.h>
|
||||
|
||||
The output from the `pkg-config` tool holds no surprises in this regard:
|
||||
|
||||
$ pkg-config --libs --static --cflags libite
|
||||
-I/usr/local/include -L/usr/local/lib -lite
|
||||
|
||||
The prefix path `/usr/local/` shown here is only the default. Use the
|
||||
`configure` script to select a different prefix when installing libite.
|
||||
|
||||
For GNU autotools based projects, use the following in `configure.ac`:
|
||||
|
||||
# Check for required libraries
|
||||
PKG_CHECK_MODULES([lite], [libite >= 1.5.0])
|
||||
|
||||
and in your `Makefile.am`:
|
||||
|
||||
proggy_CFLAGS = $(lite_CFLAGS)
|
||||
proggy_LDADD = $(lite_LIBS)
|
||||
|
||||
|
||||
Helper Macros
|
||||
-------------
|
||||
|
||||
@@ -40,15 +88,15 @@ Helper Macros
|
||||
|
||||
- `erase(path)`
|
||||
|
||||
Erase file/directory with `remove()`. Errors on stderr
|
||||
Erase file/directory with `remove()`. Errors on `stderr`
|
||||
|
||||
- `makedir(path)`
|
||||
|
||||
Create directory, like `mkdir()`. Errors on stderr
|
||||
Create directory, like `mkdir()`. Errors on `stderr`
|
||||
|
||||
- `makefifo(path)`
|
||||
|
||||
Create a FIFO, like `mkfifo()`. Errors on stderr
|
||||
Create a FIFO, like `mkfifo()`. Errors on `stderr`
|
||||
|
||||
- `min(a,b)`/`max(a,b)`
|
||||
|
||||
@@ -56,7 +104,7 @@ Helper Macros
|
||||
|
||||
- `touch(path)`
|
||||
|
||||
Create a file, or update mtime. Errors on stderr
|
||||
Create a file, or update mtime. Errors on `stderr`
|
||||
|
||||
- `S_ISEXEC(mode_t m)`
|
||||
|
||||
@@ -72,7 +120,7 @@ Helper Macros
|
||||
|
||||
- `ISOTHER(word,bit)`
|
||||
|
||||
Is any other bits, except bit, in (integer) word set?
|
||||
Are any other bits, except bit, in (integer) word set?
|
||||
|
||||
- `SETBIT(word,bit)`
|
||||
|
||||
@@ -116,11 +164,11 @@ Generic Functions
|
||||
|
||||
- `fexist(file)`
|
||||
|
||||
Check for the existance of a file, returns True(1) or False(0).
|
||||
Check for the existence of a file, returns True(1) or False(0).
|
||||
|
||||
- `fisdir(path)`
|
||||
|
||||
Check for the existance of a directory, returns True(1) or False(0).
|
||||
Check for the existence of a directory, returns True(1) or False(0).
|
||||
|
||||
- `fmode(file)`
|
||||
|
||||
@@ -135,7 +183,7 @@ Generic Functions
|
||||
- `ifconfig(ifname, addr, mask, up)`
|
||||
|
||||
Basic ifconfig like operations on an interface. Only supports IPv4
|
||||
adresses. Note that mask is not CIDR notation.
|
||||
addresses. Note that mask is not CIDR notation.
|
||||
|
||||
- `lfopen(file, sep)`, `lfclose(lf)`
|
||||
|
||||
@@ -144,7 +192,7 @@ Generic Functions
|
||||
|
||||
- `lftok(lf)`
|
||||
|
||||
Read tokens, delimeted by `sep`, from file opened with `lfopen()`.
|
||||
Read tokens, delimited by `sep`, from file opened with `lfopen()`.
|
||||
|
||||
- `lfgetkey(lf, key)`
|
||||
|
||||
@@ -187,7 +235,7 @@ Generic Functions
|
||||
existence of this file, so make sure to have your signal handlers
|
||||
properly setup before calling this function.
|
||||
|
||||
The pidfile is removed when the program exits, using an `atexit()`
|
||||
The PID file is removed when the program exits, using an `atexit()`
|
||||
handler. However, depending on how the program terminates the file
|
||||
may still exist even though the program is no longer running. This
|
||||
is only a problem for clients.
|
||||
@@ -234,10 +282,15 @@ Generic Functions
|
||||
set. The `path` argument should be a directory.
|
||||
|
||||
|
||||
OpenBSD Functions
|
||||
-----------------
|
||||
OpenBSD/NetBSD/FreeBSD Functions
|
||||
--------------------------------
|
||||
|
||||
The following are popular OpenBSD functions and highly useful macros.
|
||||
The following are popular functions and highly useful macros from the
|
||||
*BSD world of UNIX that are sadly missing on Linux.
|
||||
|
||||
- `fparseln(fp, *len, *lineno, delim, flags)`
|
||||
|
||||
http://man.openbsd.org/OpenBSD-current/man3/fparseln.3
|
||||
|
||||
- `pidfile(basename)`
|
||||
|
||||
@@ -248,6 +301,10 @@ The following are popular OpenBSD functions and highly useful macros.
|
||||
file `__pidfile_name`, similar to `__progname`. See previous section
|
||||
for details.
|
||||
|
||||
- `reallocarray(ptr, nmemb, size)`
|
||||
|
||||
http://man.openbsd.org/OpenBSD-current/man3/reallocarray.3
|
||||
|
||||
- `strlcpy(dst, src, len)`
|
||||
|
||||
http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/strlcpy.3
|
||||
@@ -279,8 +336,8 @@ weight utility library. Libite (LITE) employs the de facto standard GNU
|
||||
configure and build system:
|
||||
|
||||
./configure
|
||||
make all
|
||||
make install
|
||||
make -j5
|
||||
make install-strip
|
||||
|
||||
|
||||
TODO
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
TODO ... in no particular order
|
||||
===============================
|
||||
|
||||
* Investigate adding FreeBSD pidfile_open() et al
|
||||
* Investigate FreeBSD libutil library, could be useful for porting between unices
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ int main(void)
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f chomp.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
+2
-7
@@ -1,19 +1,14 @@
|
||||
# Use v2.61 for backwards compat with Ubuntu 12.04 LTS
|
||||
AC_PREREQ([2.61])
|
||||
AC_INIT(libite, 1.4.0, https://github.com/troglobit/libite/issues)
|
||||
AC_INIT(libite, 1.6.0, https://github.com/troglobit/libite/issues)
|
||||
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
AC_CONFIG_SRCDIR(lite.h)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_FILES([Makefile libite.pc])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_AR
|
||||
LT_INIT
|
||||
|
||||
AC_HEADER_STDC
|
||||
AC_C_CONST
|
||||
|
||||
AC_OUTPUT
|
||||
@@ -75,7 +75,6 @@
|
||||
|
||||
/**
|
||||
* Local Variables:
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
+9
-14
@@ -237,27 +237,23 @@ int movefile(char *src, char *dst)
|
||||
*/
|
||||
int fcopyfile(FILE *src, FILE *dst)
|
||||
{
|
||||
int ret;
|
||||
char *buffer;
|
||||
char *buf;
|
||||
|
||||
if (!src || !dst) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
buffer = malloc(BUFSIZ);
|
||||
if (!buffer)
|
||||
buf = malloc(BUFSIZ);
|
||||
if (!buf)
|
||||
return -1;
|
||||
|
||||
ret = do_copy(fileno(src), fileno(dst), BUFSIZ, buffer, BUFSIZ);
|
||||
if (ret > 0)
|
||||
ret = 0;
|
||||
else if (errno)
|
||||
ret = -1;
|
||||
while (fgets(buf, BUFSIZ, src))
|
||||
fputs(buf, dst);
|
||||
|
||||
free(buf);
|
||||
|
||||
free(buffer);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef UNITTEST
|
||||
@@ -267,7 +263,7 @@ int main(void)
|
||||
{
|
||||
int i = 0;
|
||||
char *files[] = {
|
||||
"/etc/passwd", "/tmp/tok", "/tmp/tok",
|
||||
"/etc/passwd", "/tmp/mypwd", "/tmp/mypwd",
|
||||
"/etc/passwd", "/tmp/", "/tmp/passwd",
|
||||
"/etc/passwd", "/tmp", "/tmp/passwd",
|
||||
NULL
|
||||
@@ -319,7 +315,6 @@ int main(void)
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f copyfile.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -222,7 +222,6 @@ int main(int argc, char *argv[])
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f dir.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -74,7 +74,6 @@ int main(void)
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f fexist.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Returns:
|
||||
* %TRUE(1) if the file exists and is a directory, otherwise %FALSE(0).
|
||||
*/
|
||||
int fisdir(char *file)
|
||||
int fisdir(const char *file)
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
@@ -73,7 +73,6 @@ int main(void)
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f fisdir.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -50,7 +50,6 @@ mode_t fmode(char *file)
|
||||
|
||||
/**
|
||||
* Local Variables:
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
/* $NetBSD: fparseln.c,v 1.10 2009/10/21 01:07:45 snj Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: fparseln.c,v 1.10 2009/10/21 01:07:45 snj Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "lite.h"
|
||||
|
||||
#define _DIAGASSERT(t)
|
||||
|
||||
static int isescaped(const char *, const char *, int);
|
||||
|
||||
/* isescaped():
|
||||
* Return true if the character in *p that belongs to a string
|
||||
* that starts in *sp, is escaped by the escape character esc.
|
||||
*/
|
||||
static int
|
||||
isescaped(const char *sp, const char *p, int esc)
|
||||
{
|
||||
const char *cp;
|
||||
size_t ne;
|
||||
|
||||
_DIAGASSERT(sp != NULL);
|
||||
_DIAGASSERT(p != NULL);
|
||||
|
||||
/* No escape character */
|
||||
if (esc == '\0')
|
||||
return 0;
|
||||
|
||||
/* Count the number of escape characters that precede ours */
|
||||
for (ne = 0, cp = p; --cp >= sp && *cp == esc; ne++)
|
||||
continue;
|
||||
|
||||
/* Return true if odd number of escape characters */
|
||||
return (ne & 1) != 0;
|
||||
}
|
||||
|
||||
|
||||
/* fparseln():
|
||||
* Read a line from a file parsing continuations ending in \
|
||||
* and eliminating trailing newlines, or comments starting with
|
||||
* the comment char.
|
||||
*/
|
||||
char *
|
||||
fparseln(FILE *fp, size_t *size, size_t *lineno, const char str[3], int flags)
|
||||
{
|
||||
static const char dstr[3] = { '\\', '\\', '#' };
|
||||
|
||||
ssize_t s;
|
||||
size_t len, ptrlen;
|
||||
char *buf;
|
||||
char *ptr, *cp;
|
||||
int cnt;
|
||||
char esc, con, nl, com;
|
||||
|
||||
_DIAGASSERT(fp != NULL);
|
||||
|
||||
len = 0;
|
||||
buf = NULL;
|
||||
ptrlen = 0;
|
||||
ptr = NULL;
|
||||
cnt = 1;
|
||||
|
||||
if (str == NULL)
|
||||
str = dstr;
|
||||
|
||||
esc = str[0];
|
||||
con = str[1];
|
||||
com = str[2];
|
||||
/*
|
||||
* XXX: it would be cool to be able to specify the newline character,
|
||||
* getdelim(3) does let us, but supporting it would diverge from BSDs.
|
||||
*/
|
||||
nl = '\n';
|
||||
|
||||
flockfile(fp);
|
||||
|
||||
while (cnt) {
|
||||
cnt = 0;
|
||||
|
||||
if (lineno)
|
||||
(*lineno)++;
|
||||
|
||||
s = getline(&ptr, &ptrlen, fp);
|
||||
if (s < 0)
|
||||
break;
|
||||
|
||||
if (s && com) { /* Check and eliminate comments */
|
||||
for (cp = ptr; cp < ptr + s; cp++)
|
||||
if (*cp == com && !isescaped(ptr, cp, esc)) {
|
||||
s = cp - ptr;
|
||||
cnt = s == 0 && buf == NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (s && nl) { /* Check and eliminate newlines */
|
||||
cp = &ptr[s - 1];
|
||||
|
||||
if (*cp == nl)
|
||||
s--; /* forget newline */
|
||||
}
|
||||
|
||||
if (s && con) { /* Check and eliminate continuations */
|
||||
cp = &ptr[s - 1];
|
||||
|
||||
if (*cp == con && !isescaped(ptr, cp, esc)) {
|
||||
s--; /* forget continuation char */
|
||||
cnt = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (s == 0) {
|
||||
/*
|
||||
* nothing to add, skip realloc except in case
|
||||
* we need a minimal buf to return an empty line
|
||||
*/
|
||||
if (cnt || buf != NULL)
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((cp = realloc(buf, len + s + 1)) == NULL) {
|
||||
funlockfile(fp);
|
||||
free(buf);
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
buf = cp;
|
||||
|
||||
(void) memcpy(buf + len, ptr, s);
|
||||
len += s;
|
||||
buf[len] = '\0';
|
||||
}
|
||||
|
||||
funlockfile(fp);
|
||||
free(ptr);
|
||||
|
||||
if ((flags & FPARSELN_UNESCALL) != 0 && esc && buf != NULL &&
|
||||
strchr(buf, esc) != NULL) {
|
||||
ptr = cp = buf;
|
||||
while (cp[0] != '\0') {
|
||||
int skipesc;
|
||||
|
||||
while (cp[0] != '\0' && cp[0] != esc)
|
||||
*ptr++ = *cp++;
|
||||
if (cp[0] == '\0' || cp[1] == '\0')
|
||||
break;
|
||||
|
||||
skipesc = 0;
|
||||
if (cp[1] == com)
|
||||
skipesc += (flags & FPARSELN_UNESCCOMM);
|
||||
if (cp[1] == con)
|
||||
skipesc += (flags & FPARSELN_UNESCCONT);
|
||||
if (cp[1] == esc)
|
||||
skipesc += (flags & FPARSELN_UNESCESC);
|
||||
if (cp[1] != com && cp[1] != con && cp[1] != esc)
|
||||
skipesc = (flags & FPARSELN_UNESCREST);
|
||||
|
||||
if (skipesc)
|
||||
cp++;
|
||||
else
|
||||
*ptr++ = *cp++;
|
||||
*ptr++ = *cp++;
|
||||
}
|
||||
*ptr = '\0';
|
||||
len = strlen(buf);
|
||||
}
|
||||
|
||||
if (size)
|
||||
*size = len;
|
||||
return buf;
|
||||
}
|
||||
@@ -112,7 +112,6 @@ int main(void)
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f fsendfile.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -85,7 +85,6 @@ int ifconfig(char *ifname, char *addr, char *mask, int up)
|
||||
|
||||
/**
|
||||
* Local Variables:
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -228,7 +228,6 @@ int main(void)
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f lfile.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: @PACKAGE@
|
||||
Description: Frog DNA, basically
|
||||
Version: @VERSION@
|
||||
Requires:
|
||||
Libs: -L${libdir} -lite
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -34,12 +34,22 @@
|
||||
#include <sys/param.h> /* MAX(), isset(), setbit(), TRUE, FALSE, et consortes. :-) */
|
||||
#include <unistd.h>
|
||||
|
||||
/*
|
||||
* fparseln() specific operation flags.
|
||||
*/
|
||||
#define FPARSELN_UNESCESC 0x01
|
||||
#define FPARSELN_UNESCCONT 0x02
|
||||
#define FPARSELN_UNESCCOMM 0x04
|
||||
#define FPARSELN_UNESCREST 0x08
|
||||
#define FPARSELN_UNESCALL 0x0f
|
||||
|
||||
typedef struct lfile lfile_t;
|
||||
|
||||
char *chomp (char *str);
|
||||
char *fparseln (FILE *, size_t *, size_t *, const char[3], int);
|
||||
|
||||
int fexist (char *file);
|
||||
int fisdir (char *file);
|
||||
int fisdir (const char *file);
|
||||
mode_t fmode (char *file);
|
||||
|
||||
FILE *tempfile (void);
|
||||
@@ -68,6 +78,8 @@ int pidfile_signal(const char *pidfile, int signal);
|
||||
pid_t pidfile_read (const char *pidfile);
|
||||
pid_t pidfile_poll (const char *pidfile);
|
||||
|
||||
void *reallocarray(void *optr, size_t nmemb, size_t size);
|
||||
|
||||
#ifndef strlcpy
|
||||
size_t strlcpy (char *dst, const char *src, size_t siz);
|
||||
#endif
|
||||
@@ -130,12 +142,16 @@ int tree(char *path, int show_perms);
|
||||
#define UNUSED(x) UNUSED_ ## x __attribute__ ((unused))
|
||||
#endif
|
||||
|
||||
|
||||
/* Does directory end with a slash? */
|
||||
static inline int fisslashdir(char *dir)
|
||||
{
|
||||
if (!dir) return 0;
|
||||
if (strlen (dir) > 0) return dir[strlen (dir) - 1] == '/';
|
||||
return 0;
|
||||
if (!dir)
|
||||
return 0;
|
||||
|
||||
if (strlen(dir) > 0)
|
||||
return dir[strlen(dir) - 1] == '/';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Convert string to natural number (0-2147483647), returns -1 on error. */
|
||||
@@ -204,7 +220,6 @@ static inline int string_case_compare (const char *a, const char *b)
|
||||
|
||||
/**
|
||||
* Local Variables:
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -117,7 +117,6 @@ int main(void)
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f makepath.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* Updated by troglobit for libite/finit/uftpd projects 2016/03/19 */
|
||||
/* $OpenBSD: pidfile.c,v 1.11 2015/06/03 02:24:36 millert Exp $ */
|
||||
/* $NetBSD: pidfile.c,v 1.4 2001/02/19 22:43:42 cgd Exp $ */
|
||||
|
||||
@@ -30,6 +31,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/stat.h> /* utimensat() */
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <paths.h>
|
||||
@@ -50,16 +52,25 @@ int
|
||||
pidfile(const char *basename)
|
||||
{
|
||||
int save_errno;
|
||||
int atexit_already;
|
||||
pid_t pid;
|
||||
FILE *f;
|
||||
|
||||
if (basename == NULL)
|
||||
basename = __progname;
|
||||
|
||||
pid = getpid();
|
||||
atexit_already = 0;
|
||||
|
||||
if (pidfile_path != NULL) {
|
||||
if (pid == pidfile_pid) {
|
||||
utimensat(0, pidfile_path, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
free(pidfile_path);
|
||||
pidfile_path = NULL;
|
||||
__pidfile_name = NULL;
|
||||
atexit_already = 1;
|
||||
}
|
||||
|
||||
/* _PATH_VARRUN includes trailing / */
|
||||
@@ -74,7 +85,6 @@ pidfile(const char *basename)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
pid = getpid();
|
||||
if (fprintf(f, "%ld\n", (long)pid) <= 0 || fflush(f) != 0) {
|
||||
save_errno = errno;
|
||||
(void) fclose(f);
|
||||
@@ -90,7 +100,7 @@ pidfile(const char *basename)
|
||||
* LITE extension, no need to set up another atexit() handler
|
||||
* if user only called us to update the mtime of the PID file
|
||||
*/
|
||||
if (pidfile_pid == pid)
|
||||
if (atexit_already)
|
||||
return (0);
|
||||
|
||||
pidfile_pid = pid;
|
||||
|
||||
+95
-30
@@ -122,28 +122,110 @@ int pidfile_signal(const char *pidfile, int signal)
|
||||
/********************************* UNIT TESTS ************************************/
|
||||
#ifdef UNITTEST
|
||||
#include <paths.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include "lite.h"
|
||||
|
||||
extern char *__progname;
|
||||
static char PIDFILE[42];
|
||||
static int verbose = 0;
|
||||
static struct stat before, after;
|
||||
|
||||
static int test(int result, const char *fmt, ...)
|
||||
{
|
||||
char buf[80];
|
||||
size_t len;
|
||||
va_list ap;
|
||||
const char success[] = " \e[1m[ OK ]\e[0m\n";
|
||||
const char failure[] = " \e[7m[FAIL]\e[0m\n";
|
||||
const char dots[] = " .....................................................................";
|
||||
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
write(STDERR_FILENO, buf, len);
|
||||
write(STDERR_FILENO, dots, 60 - len); /* pad with dots. */
|
||||
|
||||
if (!result)
|
||||
write(STDERR_FILENO, success, strlen(success));
|
||||
else
|
||||
write(STDERR_FILENO, failure, strlen(failure));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline int timespec_newer(const struct timespec *a, const struct timespec *b)
|
||||
{
|
||||
if (a->tv_sec != b->tv_sec)
|
||||
return a->tv_sec > b->tv_sec;
|
||||
|
||||
return a->tv_nsec > b->tv_nsec;
|
||||
}
|
||||
|
||||
char *timespec2str(struct timespec *ts, char *buf, size_t len)
|
||||
{
|
||||
size_t ret, pos;
|
||||
struct tm t;
|
||||
|
||||
memset(buf, 0, len);
|
||||
|
||||
tzset();
|
||||
if (localtime_r(&(ts->tv_sec), &t) == NULL)
|
||||
return buf;
|
||||
|
||||
ret = strftime(buf, len, "%F %T", &t);
|
||||
if (ret == 0)
|
||||
return buf;
|
||||
len -= ret - 1;
|
||||
|
||||
pos = strlen(buf);
|
||||
len -= pos;
|
||||
snprintf(&buf[pos], len, ".%09ld", ts->tv_nsec);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void sigterm_handler(int UNUSED(signo))
|
||||
{
|
||||
printf("Exiting ...\n");
|
||||
if (verbose)
|
||||
printf("Exiting ...\n");
|
||||
}
|
||||
|
||||
static void sigalrm_handler(int UNUSED(signo))
|
||||
{
|
||||
printf("Testing pidfile() ...\n");
|
||||
pidfile(NULL);
|
||||
|
||||
if (!fexist(PIDFILE))
|
||||
err(1, "pidfile() failed creating %s", PIDFILE);
|
||||
err(1, "failed creating %s", PIDFILE);
|
||||
stat(PIDFILE, &before);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
static int mtime()
|
||||
{
|
||||
char cmd[80];
|
||||
int ret;
|
||||
char buf[80];
|
||||
|
||||
/* Must sleep a while here otherwise we execute too fast => no mtime change :-( */
|
||||
usleep(10000);
|
||||
|
||||
if (verbose)
|
||||
printf("Calling pidfile() again to update mtime ...\n");
|
||||
pidfile(NULL);
|
||||
stat(PIDFILE, &after);
|
||||
|
||||
ret = timespec_newer(&after.st_mtim, &before.st_mtim);
|
||||
if (verbose) {
|
||||
printf("Before: %s\n", timespec2str(&before.st_mtim, buf, sizeof(buf)));
|
||||
printf("After : %s\n", timespec2str(&after.st_mtim, buf, sizeof(buf)));
|
||||
}
|
||||
|
||||
return !ret;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc > 1 && !strcmp(argv[1], "-v"))
|
||||
verbose = 1;
|
||||
|
||||
snprintf(PIDFILE, sizeof(PIDFILE), "%s%s.pid", _PATH_VARRUN, __progname);
|
||||
|
||||
@@ -151,36 +233,19 @@ int main(void)
|
||||
signal(SIGALRM, sigalrm_handler);
|
||||
alarm(1);
|
||||
|
||||
printf("Testing pidfile_poll() ...\n");
|
||||
if (!pidfile_poll(PIDFILE))
|
||||
printf("Timed out!\n");
|
||||
else
|
||||
printf("We got signal!\n");
|
||||
return test(pidfile_poll(PIDFILE) != getpid(), "Testing pidfile_poll()")
|
||||
|| test(strcmp(__pidfile_name, PIDFILE), "Testing __pidfile_name vs guessed PID filename")
|
||||
|| test(mtime(), "Testing mtime update of followup pidfile() call")
|
||||
|| test(pidfile_signal(PIDFILE, SIGTERM), "Testing signalling ourselves")
|
||||
;
|
||||
|
||||
printf("Reading pid file, should be %d ...\n", getpid());
|
||||
printf("=> %d\n", pidfile_read(PIDFILE));
|
||||
|
||||
printf("\nComparing __pidfile_name with our guessed PID filename ...\n");
|
||||
printf("strcmp(\"%s\",\n \"%s\") => %s\n\n", __pidfile_name, PIDFILE,
|
||||
!strcmp(__pidfile_name, PIDFILE) ? "OK" : "FAIL");
|
||||
|
||||
/* Occular verification that calling pidfile() again updates mtime */
|
||||
snprintf(cmd, sizeof(cmd), "ls -l --full-time %s", PIDFILE);
|
||||
system(cmd);
|
||||
printf("Before ^^ pidfile() vv after ...\n");
|
||||
pidfile(NULL);
|
||||
system(cmd);
|
||||
|
||||
printf("Signalling ourselves ...\n");
|
||||
|
||||
return pidfile_signal(PIDFILE, SIGTERM);
|
||||
return 0;
|
||||
}
|
||||
#endif /* UTEST_PIDFN */
|
||||
#endif /* UNITTEST */
|
||||
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f pidfilefn.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -168,7 +168,6 @@ int main(void)
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f progress.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/* $OpenBSD: reallocarray.c,v 1.2 2014/12/08 03:45:00 bcook Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*
|
||||
* This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
|
||||
* if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
|
||||
*/
|
||||
#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
|
||||
|
||||
void *
|
||||
reallocarray(void *optr, size_t nmemb, size_t size)
|
||||
{
|
||||
if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
|
||||
nmemb > 0 && SIZE_MAX / nmemb < size) {
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
return realloc(optr, size * nmemb);
|
||||
}
|
||||
@@ -306,7 +306,6 @@ int main(int argc, char *argv[])
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f rsync.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
@@ -8,7 +8,7 @@ AR ?= $(CROSS)ar
|
||||
STRIP ?= $(CROSS)strip
|
||||
INSTALL := install --backup=off
|
||||
STRIPINST := $(INSTALL) -s --strip-program=$(CROSS)strip -m 0755
|
||||
|
||||
CFLAGS += -g -O0
|
||||
CPPFLAGS += -D_GNU_SOURCE
|
||||
ARFLAGS = crus
|
||||
|
||||
|
||||
+2
-2
@@ -24,7 +24,8 @@
|
||||
|
||||
#ifndef O_TMPFILE /* Too old GLIBC or kernel */
|
||||
#warning O_TMPFILE missing on your system, tempfile() may not work!
|
||||
#define O_TMPFILE 020200000 /* Define and let it fail at runtime */
|
||||
#define __O_TMPFILE 020000000
|
||||
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) /* Define and let it fail at runtime */
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -70,7 +71,6 @@ int main(void)
|
||||
/**
|
||||
* Local Variables:
|
||||
* compile-command: "make V=1 -f tempfile.mk"
|
||||
* version-control: t
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
|
||||
Reference in new issue
Block a user