summaryrefslogtreecommitdiff
path: root/modutils/modprobe.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-14 02:23:43 +0000
committerDenis Vlasenko2006-10-14 02:23:43 +0000
commitea62077b850076c4d7dc3cf78ebd1888928c6ddf (patch)
tree37b7584ae40b99edb5583fbc4392b62ffdadf278 /modutils/modprobe.c
parent88ca06769028e442bf873b270c176ca0e9f021f8 (diff)
downloadbusybox-ea62077b850076c4d7dc3cf78ebd1888928c6ddf.zip
busybox-ea62077b850076c4d7dc3cf78ebd1888928c6ddf.tar.gz
add open_read_close() and similar stuff
Diffstat (limited to 'modutils/modprobe.c')
-rw-r--r--modutils/modprobe.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index b629390..ab595c8 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -93,35 +93,6 @@ static int parse_tag_value ( char *buffer, char **ptag, char **pvalue )
return 1;
}
-/* Jump through hoops to simulate how fgets() grabs just one line at a
- * time... Don't use any stdio since modprobe gets called from a kernel
- * thread and stdio junk can overflow the limited stack...
- */
-static char *reads ( int fd, char *buffer, size_t len )
-{
- int n = read ( fd, buffer, len );
-
- if ( n > 0 ) {
- char *p;
-
- buffer [len-1] = 0;
- p = strchr ( buffer, '\n' );
-
- if ( p ) {
- off_t offset;
-
- offset = lseek ( fd, 0L, SEEK_CUR ); // Get the current file descriptor offset
- lseek ( fd, offset-n + (p-buffer) + 1, SEEK_SET ); // Set the file descriptor offset to right after the \n
-
- p[1] = 0;
- }
- return buffer;
- }
-
- else
- return 0;
-}
-
/*
* This function appends an option to a list
*/
@@ -913,7 +884,7 @@ int modprobe_main(int argc, char** argv)
depend = build_dep ( );
if ( !depend )
- bb_error_msg_and_die ( "could not parse modules.dep" );
+ bb_error_msg_and_die ( "cannot parse modules.dep" );
if (remove_opt) {
do {