projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Random documentation fixes
[git.git]
/
mailsplit.c
diff --git
a/mailsplit.c
b/mailsplit.c
index
9379fbc
..
7afea1a
100644
(file)
--- a/
mailsplit.c
+++ b/
mailsplit.c
@@
-77,7
+77,7
@@
static int parse_email(const void *map, unsigned long size)
/*
* Search for a line beginning with "From ", and
/*
* Search for a line beginning with "From ", and
- * having smething that looks like a date format.
+ * having s
o
mething that looks like a date format.
*/
do {
int len = linelen(map, size);
*/
do {
int len = linelen(map, size);
@@
-116,8
+116,9
@@
int main(int argc, char **argv)
}
size = st.st_size;
map = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
}
size = st.st_size;
map = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
- if (
-1 == (int)(long)map
) {
+ if (
map == MAP_FAILED
) {
perror("mmap");
perror("mmap");
+ close(fd);
exit(1);
}
close(fd);
exit(1);
}
close(fd);
@@
-127,7
+128,7
@@
int main(int argc, char **argv)
unsigned long len = parse_email(map, size);
assert(len <= size);
sprintf(name, "%04d", ++nr);
unsigned long len = parse_email(map, size);
assert(len <= size);
sprintf(name, "%04d", ++nr);
- fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 06
00
);
+ fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 06
66
);
if (fd < 0) {
perror(name);
exit(1);
if (fd < 0) {
perror(name);
exit(1);