From d17c3160bd4b03de178143628d6189bdca280a0c Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Sun, 17 Feb 2008 08:11:51 -0300 Subject: [PATCH] Size 0 in copyfile copies entire file (semantics of <0 reserved) Also updated documentation Signed-off-by: Claudio Matsuoka --- README | 8 +++++--- helpers.c | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README b/README index f7c0e71e..7554f159 100644 --- a/README +++ b/README @@ -56,9 +56,9 @@ Using finit with alternative systems Currently tested only with Mandriva 2008. Proceed with caution, there are problems related to udev and pam. -1 - add init=/sbin/finit-mdv to the kernel boot line +1 - Add init=/sbin/finit-mdv to the kernel boot line -2 - provide a suitable /usr/sbin/services.sh, this is the one I use in my +2 - Provide a suitable /usr/sbin/services.sh, this is the one I use in my test system: mkdir /var/lock/subsys @@ -69,5 +69,7 @@ problems related to udev and pam. /etc/init.d/portmap start /etc/init.d/nfs-common start -3 - Create /etc/hostname if you don't have it already +3 - Provide /etc/hostname if you don't have it already + +4 - Set the pointer device in the X server configuration to /dev/input/mice diff --git a/helpers.c b/helpers.c index 81b4d56d..caba0481 100644 --- a/helpers.c +++ b/helpers.c @@ -71,8 +71,8 @@ void copyfile(char *src, char *dst, int size) if ((s = open(src, O_RDONLY)) >= 0) { if ((d = open(dst, O_WRONLY | O_CREAT, 0644)) >= 0) { - /* Size <= 0 means copy entire file */ - if (size <= 0) { + /* Size == 0 means copy entire file */ + if (size == 0) { do { if ((n = read(s, buffer, BUF_SIZE)) > 0) write(d, buffer, n);