summaryrefslogtreecommitdiffstats
path: root/libbb
Commit message (Collapse)AuthorAgeFilesLines
* Name it after what it does: s/extract_to_stdout/extract_to_stream/graham.gower2009-11-262-2/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@388 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* libbb.h cleanup.graham.gower2009-11-254-276/+6
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@385 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Various unarchive.c cleanups.graham.gower2009-11-251-54/+42
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@384 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Don't leak the ar_header or the tar_header.graham.gower2009-11-221-0/+3
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@347 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix hang in waitpid, exposed by r310. Patch from Enrico Scholzgraham.gower2009-11-191-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <enrico.scholz@informatik.tu-chemnitz.de>, his analysis follows. libbb/unarchive.c: prevent opkg hang when subprocess is stuck in a write() call on a filled pipe and main process (which assumes that end of data from pipe has been reached) waits for this died subprocess. This patch swaps the original wait(pid) + close(pipe) sequencse so that pipe is closed first. The 'ar' code path has been fixed too by breaking the loop when requested data have been found. Previously, the loop continued at the (wrongly calculated) next position in the stream. The patch moves the stream cleanup at a better place. Variable declarations were moved to inner scopes too to ease detection of broken deallocation. NOTE: the | f = fdopen(...); | while (... /* do fread(f) */ ...) { /* ==1== */ | /* this is done in gz_open() */ | pid = fork(); | if (pid == 0) { | fread(f); /* ==2== */ | _exit(0); | } | } code looks problematic because '==2==' might update f's internal buffer. As ==2== is done in an own process, these changes are not seen by ==1==. It works only because gz_open() is called not more than one time and the loops break (after the patch). git-svn-id: http://opkg.googlecode.com/svn/trunk@340 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove unused function.graham.gower2009-11-172-119/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@332 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix the warnings I created.graham.gower2009-11-161-0/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@326 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Call _exit() and not exit() from within the child process.graham.gower2009-11-162-3/+4
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@325 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove dead code.graham.gower2009-11-154-58/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@314 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Don't send the gzunp_pid SIGTERM. Waiting for exit should be sufficient.graham.gower2009-11-151-4/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@310 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Free memory in error paths.graham.gower2009-11-151-2/+8
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@308 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* malloc -> xmallocgraham.gower2009-11-151-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@307 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* The ": " is already added by vperror_msg... oops.graham.gower2009-11-151-4/+4
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@306 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Cleanup gz_close().graham.gower2009-11-152-21/+13
| | | | | | | | - Don't try to free() memory in a different process! - Move the function to a more appropriate file. - Fix error messages while here. git-svn-id: http://opkg.googlecode.com/svn/trunk@305 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Make the array const to fix warning.graham.gower2009-11-152-6/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@304 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* I'm still seeing leaks here. So just stop allocating for these variables.graham.gower2009-11-151-8/+5
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@303 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* More cleanup in error paths to plug leaks found while installing dbus.graham.gower2009-11-101-4/+3
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@280 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix memory leaks.graham.gower2009-11-011-13/+21
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@233 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* The compiler almost certainly knows better.graham.gower2009-10-301-15/+15
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@228 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix implicit declaration of strnduppixdamix2009-10-281-1/+1
| | | | | | | | s/strndup/xstrndup/ Thanks to Graham Gower <graham.gower@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@224 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Improve the poor man's fseek in unarchive.cpixdamix2009-10-271-6/+22
| | | | | | | | | | Modified seek_sub_file since the fgetc in the for loop was very slow when installing huge packages. A test on my machine showed a 4x gain when installing a large package (23Mib) git-svn-id: http://opkg.googlecode.com/svn/trunk@222 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix opkg doesn't handle long link/path names in tar files wellticktock352009-09-211-3/+4
| | | | | | | | | | | | | 1. provide opkg with a tar file that has a link name that is 100 characters or 2. provide opkg with a tar file that has a 'path_prefix' of 155 characters. Thanks to pblack88@gmail.com http://code.google.com/p/opkg/issues/detail?id=21 git-svn-id: http://opkg.googlecode.com/svn/trunk@217 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Thanks to claudyus84 and Gillesticktock352009-06-261-2/+2
| | | | | | | | | http://www.crisos.org/flyspray/index.php?do=details&task_id=10 Fix issue: http://code.google.com/p/opkg/issues/detail?id=4#c5 git-svn-id: http://opkg.googlecode.com/svn/trunk@214 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Thanks to Antonioticktock352009-03-261-0/+10
| | | | | | | | | | | Propagate gz_open() errors to caller function. This is not enough, it is still needed to check deb_extract return value everywhere in libopkg/pkg_extract.c Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> git-svn-id: http://opkg.googlecode.com/svn/trunk@205 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Thanks to Krzysztof Kotlenga <pocek@users.sf.net>:ticktock352009-03-031-8/+8
| | | | | | | | | | | | | | Frans Meulenbroeks wrote: > Anyway, appending the 0 byte is no good as tar_entry->name[100] is > already out of bounds. http://tiny.cc/964UD looks good enough. It's interesting that we have to trace bugs already fixed upstream years ago. http://lists.linuxtogo.org/pipermail/openembedded-devel/2009-March/008510.html git-svn-id: http://opkg.googlecode.com/svn/trunk@203 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Thanks toticktock352009-02-121-0/+4
| | | | | | | | | | | | | | | | | | Frans Meulenbroeks http://groups.google.com/group/opkg-devel/browse_thread/thread/23c3557277de0f2e If a file name in a tar archive is exactly 100 bytes long the name field is completely filled and there is no terminating null byte; so extraction of the file will yield a name that is extended with the mode (e.g. 000644). The attached patch cures it although there might be better solutions. The problem is also in busybox tar and reported there too. Frans. git-svn-id: http://opkg.googlecode.com/svn/trunk@201 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* revert R190, keep R191ticktock352008-12-273-83/+6
| | | | | | | Waiting for the patch fixing bugs. git-svn-id: http://opkg.googlecode.com/svn/trunk@192 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Thanks for Mike Westerhof <mwester@dls.net>ticktock352008-12-273-6/+83
| | | | | | | | | | | | | | | | | | | | | | ---------- This patchset updates the libbb stuff to use a vfork() version of gz_open, called gzvopen. This is done because a standard fork will duplicate the entire address space. This will invoke the OOM (out of memory) killer on small-memory machines, because most often by the time we unzip any package, we've read the entire package database into memory already. By using vfork() and immediatly execing the external gunzip utility, we avoid the need to clone the entire address space. Yes, this is actually **LESS** efficient than the original way! But there is no way to (currently) dodge the OOM killer on a per-process basis, so the alternatives are to either change the OOM killer behavior system-wide, or to use this workaround. Mike Westerhof, Dec 2008 git-svn-id: http://opkg.googlecode.com/svn/trunk@190 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: trivial, clean up obsolete code, and some typoticktock352008-12-151-20/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@157 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: attached patch fixes build failures with gcc 4.3.2. patch by Enrico ↵ticktock352008-12-152-11/+0
| | | | | | Scholz -- thanks! git-svn-id: http://opkg.googlecode.com/svn/trunk@151 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* [opkg] trivial, remove unused variable resticktock352008-12-151-1/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@148 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: (leak fixing, day 3) fixed final memory leaks fixed reported fromticktock352008-12-151-0/+2
| | | | | | | | running libopkg_test git-svn-id: http://opkg.googlecode.com/svn/trunk@116 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: fix some initialisation and double free issues in libbbticktock352008-12-152-2/+5
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@85 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg/libbb: Patch from Esben Haabendal <esbenhaabendal gmail com>ticktock352008-12-141-6/+14
| | | | | | | | Fix the usage of dirname() in libbb/make_directory.c, as it is not correct according to the standard specification for dirname. git-svn-id: http://opkg.googlecode.com/svn/trunk@48 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* * Rename top level ipkg directory to opkgticktock352008-12-142-11/+11
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@8 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* ipkg: remove more auto-generated filesticktock352008-12-141-649/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@6 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* * Add ipkg for future developmentticktock352008-12-1427-0/+4373
git-svn-id: http://opkg.googlecode.com/svn/trunk@3 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358