eofnl: check for extra trailing newlines

Enforce exactly one trailing \n, and fix all of the existing cases.

Change-Id: I6218e4700e90aeb647eaee78089530c79993c8c8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-10-11 10:06:29 -07:00
parent 422eab7106
commit 1a37acda67
20 changed files with 12 additions and 22 deletions

View File

@ -19,4 +19,3 @@ integrated into the SPDK build by updating the following line
in CONFIG: in CONFIG:
CONFIG_NVME_IMPL=nvme_impl.h CONFIG_NVME_IMPL=nvme_impl.h

View File

@ -8,4 +8,3 @@ rootdir=$(readlink -f $(dirname $0))
$rootdir/autobuild.sh $rootdir/autobuild.sh
sudo $rootdir/autotest.sh sudo $rootdir/autotest.sh
$rootdir/autopackage.sh $rootdir/autopackage.sh

View File

@ -1354,4 +1354,3 @@ tr.heading h2 {
display:inline; display:inline;
} }
} }

View File

@ -165,4 +165,3 @@
UseDigest Auto UseDigest Auto
LUN0 Nvme0 LUN0 Nvme0
QueueDepth 32 QueueDepth 32

View File

@ -72,4 +72,3 @@ struct file_disk {
struct file_disk *create_aio_disk(char *fname); struct file_disk *create_aio_disk(char *fname);
#endif // SPDK_BLOCKDEV_AIO_H #endif // SPDK_BLOCKDEV_AIO_H

View File

@ -110,4 +110,3 @@ spdk_cunit_print_results(const char *filename)
fclose(out); fclose(out);
return 0; return 0;
} }

1
lib/env/env.mk vendored
View File

@ -70,4 +70,3 @@ ENV_CFLAGS = $(DPDK_INC)
ENV_CXXFLAGS = $(ENV_CFLAGS) ENV_CXXFLAGS = $(ENV_CFLAGS)
ENV_LIBS = $(SPDK_ROOT_DIR)/lib/env/libspdk_env.a $(DPDK_LIB) ENV_LIBS = $(SPDK_ROOT_DIR)/lib/env/libspdk_env.a $(DPDK_LIB)
ENV_LINKER_ARGS = -Wl,--start-group -Wl,--whole-archive $(SPDK_ROOT_DIR)/lib/env/libspdk_env.a $(DPDK_LIB) -Wl,--end-group -Wl,--no-whole-archive ENV_LINKER_ARGS = -Wl,--start-group -Wl,--whole-archive $(SPDK_ROOT_DIR)/lib/env/libspdk_env.a $(DPDK_LIB) -Wl,--end-group -Wl,--no-whole-archive

View File

@ -177,4 +177,3 @@ int spdk_iscsi_conn_read_data(struct spdk_iscsi_conn *conn, int len,
void *buf); void *buf);
#endif /* SPDK_ISCSI_CONN_H */ #endif /* SPDK_ISCSI_CONN_H */

View File

@ -64,4 +64,3 @@ spdk_iscsi_task_get(uint32_t *owner_task_ctr, struct spdk_iscsi_task *parent)
return task; return task;
} }

View File

@ -1090,4 +1090,3 @@ nvme_qpair_fail(struct spdk_nvme_qpair *qpair)
SPDK_NVME_SC_ABORTED_BY_REQUEST, 1 /* do not retry */, true); SPDK_NVME_SC_ABORTED_BY_REQUEST, 1 /* do not retry */, true);
} }
} }

View File

@ -215,4 +215,3 @@ spdk_io_channel_get_ctx(struct spdk_io_channel *ch)
{ {
return (uint8_t *)ch + sizeof(*ch); return (uint8_t *)ch + sizeof(*ch);
} }

View File

@ -8,10 +8,19 @@ if [ -z "$f" ]; then
exit 1 exit 1
fi fi
if [[ -f "$f" && $(tail -c1 "$f") ]]; then if [ ! -f "$f" ]; then
exit 0
fi
if [[ $(tail -c1 "$f") ]]; then
echo "$f: No newline at end of file" echo "$f: No newline at end of file"
echo '' >> "$f" echo '' >> "$f"
exit 1 exit 1
else
exit 0
fi fi
if [[ ! $(tail -c2 "$f") ]]; then
echo "$f: Extra trailing newline"
exit 1
fi
exit 0

View File

@ -6,4 +6,3 @@ IP=127.0.0.1
AuthMethod=CHAP,None AuthMethod=CHAP,None
UserName=root UserName=root
PassWord=tester PassWord=tester

View File

@ -106,4 +106,3 @@ int main(int argc, char **argv)
CU_cleanup_registry(); CU_cleanup_registry();
return num_failures; return num_failures;
} }

View File

@ -36,4 +36,3 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..)
TEST_FILE = nvme_ut.c TEST_FILE = nvme_ut.c
include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk

View File

@ -37,4 +37,3 @@ TEST_FILE = nvme_ctrlr_ut.c
OTHER_FILES = nvme_intel.c OTHER_FILES = nvme_intel.c
include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk

View File

@ -36,4 +36,3 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..)
TEST_FILE = nvme_ctrlr_cmd_ut.c TEST_FILE = nvme_ctrlr_cmd_ut.c
include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk

View File

@ -37,4 +37,3 @@ TEST_FILE = nvme_ns_cmd_ut.c
OTHER_FILES = nvme.c OTHER_FILES = nvme.c
include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk

View File

@ -36,4 +36,3 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..)
TEST_FILE = nvme_qpair_ut.c TEST_FILE = nvme_qpair_ut.c
include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk include $(SPDK_ROOT_DIR)/mk/nvme.unittest.mk

View File

@ -1022,4 +1022,3 @@ int main(int argc, char **argv)
CU_cleanup_registry(); CU_cleanup_registry();
return num_failures; return num_failures;
} }