Commit Graph

16 Commits

Author SHA1 Message Date
Sami Kerola 2226064c52 rev: memory leak fix
Moving the malloc out of loop will make leak to disappear, and
the command might run few jiffie quicker when there are 1+N
arguments.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:45:02 +02:00
Sami Kerola 099bce7f5d rev: use xrealloc from xalloc.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:44:59 +02:00
Fabian Groffen eb76ca98b0 build-sys: provide alternatives for err, errx, warn and warnx
Solaris lacks err, errx, warn and warnx.  This also means the err.h header
doesn't exist.  Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-02-14 17:45:24 +01:00
Davidlohr Bueso 3924d0f169 rev: use xalloc for memory allocation
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-01 15:17:11 +01:00
Marek Polacek 50644ff4de use _exit() instead of exit() in sighandlers
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-10-29 13:26:25 +02:00
Davidlohr Bueso 06eee0d84f rev: coding style, various fixes
* Change indentation to 8 characters and coding style, for better reading the code.

 * Add some memory allocation error handling.

 * Fix memory leaks. In cases when Ctrl-C is used to exit the program,
  'p' cannot be freed, so made it a global var, to share between main()
   and sig_handler(). Signal handing is necessary to fix some leaks, so
   added a very basic, non invasive, mechanism.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-08-20 12:05:42 +02:00
Li Zefan fffe39059d rev: use warn() in errs.h
The function warn() in rev.c is actually duplicate code,
so here we remove it.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-25 21:50:59 +02:00
Karel Zak ffc4374869 Imported from util-linux-2.11o tarball. 2006-12-07 00:25:53 +01:00
Karel Zak c07ebfa1e0 Imported from util-linux-2.11b tarball. 2006-12-07 00:25:46 +01:00
Karel Zak 22853e4a82 Imported from util-linux-2.10m tarball. 2006-12-07 00:25:43 +01:00
Karel Zak eb63b9b8f4 Imported from util-linux-2.10f tarball. 2006-12-07 00:25:41 +01:00
Karel Zak 7eda085c41 Imported from util-linux-2.9v tarball. 2006-12-07 00:25:39 +01:00
Karel Zak 2b6fc908bc Imported from util-linux-2.8 tarball. 2006-12-07 00:25:35 +01:00
Karel Zak fd6b7a7ffc Imported from util-linux-2.7.1 tarball. 2006-12-07 00:25:34 +01:00
Karel Zak 726f69e29c Imported from util-linux-2.5 tarball. 2006-12-07 00:25:33 +01:00
Karel Zak 6dbe3af945 Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00