summaryrefslogtreecommitdiffstats
path: root/usr.bin/gcore
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2004-02-15 22:48:25 +0000
committerdwmalone <dwmalone@FreeBSD.org>2004-02-15 22:48:25 +0000
commit36469a7a4ca39f1b063d91255ec320552ba036a8 (patch)
treeb0b41247c2ff77fbd24594d32b3e30f72e0ed45a /usr.bin/gcore
parentf603a8a33885717d6af640cdc49acfdc27381a10 (diff)
downloadFreeBSD-src-36469a7a4ca39f1b063d91255ec320552ba036a8.zip
FreeBSD-src-36469a7a4ca39f1b063d91255ec320552ba036a8.tar.gz
Fix some WARNS:
1) Remove some unused variables. 2) Mark some things aas static or __unused. 3) Cast to make sure we're comparing the same types.
Diffstat (limited to 'usr.bin/gcore')
-rw-r--r--usr.bin/gcore/aoutcore.c6
-rw-r--r--usr.bin/gcore/elfcore.c7
-rw-r--r--usr.bin/gcore/gcore.c2
3 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/gcore/aoutcore.c b/usr.bin/gcore/aoutcore.c
index dfb8718..fac3fb9 100644
--- a/usr.bin/gcore/aoutcore.c
+++ b/usr.bin/gcore/aoutcore.c
@@ -126,7 +126,7 @@ aoutident(int efd, pid_t pid, char *binfile)
errx(1, "%d: process exiting", pid);
if (ki->ki_flag & P_SYSTEM) /* Swapper or pagedaemon. */
errx(1, "%d: system process", pid);
- if (exec.a_text != ptoa(ki->ki_tsize))
+ if (exec.a_text != (unsigned long)ptoa(ki->ki_tsize))
errx(1, "The executable %s does not belong to"
" process %d!\n"
"Text segment size (in bytes): executable %ld,"
@@ -142,8 +142,8 @@ aoutident(int efd, pid_t pid, char *binfile)
* core --
* Build the core file.
*/
-void
-aoutcore(int efd, int fd, pid_t pid)
+static void
+aoutcore(int efd, int fd, pid_t pid __unused)
{
union {
struct user user;
diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c
index bdfd9bb..c6a161d 100644
--- a/usr.bin/gcore/elfcore.c
+++ b/usr.bin/gcore/elfcore.c
@@ -80,11 +80,10 @@ static void readhdrinfo(pid_t, prstatus_t *, prfpregset_t *, prpsinfo_t *);
static vm_map_entry_t readmap(pid_t);
static int
-elf_ident(int efd, pid_t pid, char *binfile)
+elf_ident(int efd, pid_t pid __unused, char *binfile __unused)
{
Elf_Ehdr hdr;
int cnt;
- uid_t uid;
cnt = read(efd, &hdr, sizeof(hdr));
if (cnt != sizeof(hdr))
@@ -97,8 +96,8 @@ elf_ident(int efd, pid_t pid, char *binfile)
/*
* Write an ELF coredump for the given pid to the given fd.
*/
-void
-elf_coredump(int efd, int fd, pid_t pid)
+static void
+elf_coredump(int efd __unused, int fd, pid_t pid)
{
vm_map_entry_t map;
struct sseg_closure seginfo;
diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c
index 4db514d..7005e83 100644
--- a/usr.bin/gcore/gcore.c
+++ b/usr.bin/gcore/gcore.c
@@ -83,7 +83,7 @@ SET_DECLARE(dumpset, struct dumpers);
int
main(int argc, char *argv[])
{
- int ch, cnt, efd, fd, sflag;
+ int ch, efd, fd, sflag;
char *binfile, *corefile;
char fname[MAXPATHLEN];
struct dumpers **d, *dumper;
OpenPOWER on IntegriCloud