Re: review request: truncate(1)

2000-05-26 Thread Alexander Langer

Thus spake Johan Karlsson ([EMAIL PROTECTED]):

 However, the man page does not mention that one have to also 
 specify the wanted size of the file.

Oooops :-) *correcting*

Alex
-- 
I need a new ~/.sig.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: review request: truncate(1)

2000-05-26 Thread Johan Karlsson

Hi again,

I found your updated version and I look good.

However, I just realised that I would get ride of the modeset variable by 
moving the default assignment of mode to the begining.

/Johan K

--- truncate.c.orig Fri May 26 10:34:54 2000
+++ truncate.c  Fri May 26 10:37:52 2000
@@ -46,8 +46,9 @@
int fd;
int optch;
mode_t  mode, *modp;
-   int modeset = 0;
 
+   mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
+   
while ((optch = getopt(argc, argv, "hm:")) != -1)
switch (optch) {
case 'h':
@@ -59,7 +60,6 @@
umask(0);
mode = getmode(modp, 0);
free(modp);
-   modeset = 1;
break;
case '?':
default:
@@ -74,8 +74,6 @@
usage();
exit(1);
}
-   if (!modeset)
-   mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
 
size = atol(*argv++);
 




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: review request: truncate(1)

2000-05-25 Thread Johan Karlsson

At Thu, 25 May 2000 14:18:17 +0200, Alexander Langer wrote:
Hello!

I've written the command-line frontend to truncate(2).
I've often needed that since now, and finally I wrote it.

I'm sure it's useful.

Please review (includes source, manpage + Makefile).

http://big.endian.de/FreeBSD/truncate.tar.gz

Thanks


Hi
Please sort the options in getopt and in the switch-statement.

see style(9) for more style info.


Please also use -Wall when compiling to catch all warnings
(add 
CFLAGS += -Wall
to your Makefile).


/Johan K


Alex
-- 
I need a new ~/.sig.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message





To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: review request: truncate(1)

2000-05-25 Thread Alexander Langer

Thus spake Johan Karlsson ([EMAIL PROTECTED]):

 Please sort the options in getopt and in the switch-statement.
 see style(9) for more style info.
 Please also use -Wall when compiling to catch all warnings

True - forget about that.

What about the other things, I mean non-stylistic but
functional/technical stuff?


Alex

-- 
I need a new ~/.sig.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: review request: truncate(1)

2000-05-25 Thread Johan Karlsson

At Thu, 25 May 2000 16:52:43 +0200, Alexander Langer wrote:
Thus spake Johan Karlsson ([EMAIL PROTECTED]):

 Please sort the options in getopt and in the switch-statement.
 see style(9) for more style info.
 Please also use -Wall when compiling to catch all warnings

True - forget about that.

What about the other things, I mean non-stylistic but
functional/technical stuff?


I think it looks just fine and the program works 
like I expect it to.

However, the man page does not mention that one have to also 
specify the wanted size of the file.


/Johan K


Alex

-- 
I need a new ~/.sig.





To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message