Skip to content

Commit a509e4a

Browse files
committed
core: rewrite error message sentences
1 parent 255cb3e commit a509e4a

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static void config_threads(void)
2828
if (g_conf.threads == 0)
2929
g_conf.threads = (unsigned int) max_threads;
3030
else if (g_conf.threads > (unsigned int) max_threads)
31-
error("Cannot use more than %ld threads", max_threads);
31+
error("cannot use more than %ld threads", max_threads);
3232
}
3333

3434

src/dedupe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void tag_subchunks(threadpool thpool, const t_chunk *parent)
2626
{
2727
heap_chunk = malloc(sizeof(t_chunk));
2828
if (heap_chunk == NULL)
29-
die("could not malloc() heap_chunk");
29+
die("cannot malloc() heap_chunk");
3030
memcpy(heap_chunk, &chunk, sizeof(t_chunk));
3131
/* thpool already prints error unless DISABLE_PRINT is defined */
3232
if (thpool_add_work(thpool, (void*)cleanout_chunk, heap_chunk) != 0)
@@ -77,7 +77,7 @@ static void tag_subchunks(const t_chunk *parent)
7777
{
7878
heap_chunk = malloc(sizeof(t_chunk));
7979
if (heap_chunk == NULL)
80-
die("could not malloc() heap_chunk");
80+
die("cannot malloc() heap_chunk");
8181
memcpy(heap_chunk, &chunk, sizeof(t_chunk));
8282

8383
cleanout_chunk(heap_chunk);

src/hmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ void init_hmap(size_t size)
1313
t_line *area;
1414

1515
if (g_hmap.ptr != NULL)
16-
error("create_hmap(): singleton called twice !");
16+
error("init_hmap(): singleton called twice !");
1717

1818
area = (t_line*) malloc(size * sizeof(t_line));
1919
if (area == NULL)
20-
error("cannot malloc() hash map: %s", ERRNO);
20+
die("cannot malloc() hash map");
2121

2222
g_hmap.ptr = area;
2323
g_hmap.size = size;
@@ -100,7 +100,7 @@ void populate_hmap(t_chunk *chunk)
100100
slot = (slot + 1) % g_hmap.size;
101101
}
102102
if (!has_slots)
103-
error("populate_hmap(): no space left on hashmap.");
103+
error("populate_hmap(): too much slots in use");
104104
i++;
105105
if (i == 500000) {
106106
set_status(TAGDUP_BYTES, (size_t)(chunk->ptr - base_ptr));

src/meminfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static long long proc_meminfo(const char *identifier)
8080
size = BUF_SIZE * sizeof(*buf);
8181
buf = (char*) malloc(size);
8282
if (buf == NULL)
83-
die("malloc()");
83+
die("cannot malloc() proc_meminfo buffer");
8484

8585
result = -1LL;
8686
identifier_len = strlen(identifier);

src/optparse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void optparse(int argc, char **argv)
245245
setopt_help(NULL);
246246

247247
if (g_conf.lowercase_wordlist && g_conf.uppercase_wordlist)
248-
error("can't use '--lowercase' and '--uppercase' together");
248+
error("cannot use '--lowercase' and '--uppercase' together");
249249

250250
if (g_conf.outfile_name == NULL)
251251
error("mandatory argument: --outfile");

src/uinput.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ void watch_user_input(void)
7070

7171
config_termios();
7272
if (pthread_create(&tid, NULL, &watch_user_input_worker, NULL) < 0)
73-
error("can't create watch_user_input_worker() thread: %s", ERRNO);
73+
error("cannot create watch_user_input_worker() thread: %s", ERRNO);
7474
}

test/tests/user-interface.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ set -ve
2121
./duplicut /etc/passwd -o /tmp/x -c &> /dev/null
2222
./duplicut /etc/passwd -o /tmp/x -C &> /dev/null
2323
! ./duplicut /etc/passwd -o /tmp/x -c -C &> /dev/null
24-
./duplicut /etc/passwd -o /tmp/x -c -C 2>&1 | grep -q "can't use '--lowercase' and '--uppercase' together"
24+
./duplicut /etc/passwd -o /tmp/x -c -C 2>&1 | grep -q "cannot use '--lowercase' and '--uppercase' together"

0 commit comments

Comments
 (0)