include/opcode/
[external/binutils.git] / gdb / fbsd-nat.c
index 4a8a509..6a362da 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for FreeBSD.
 
-   Copyright (C) 2002-2004, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2002-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -39,7 +39,7 @@
 char *
 fbsd_pid_to_exec_file (int pid)
 {
-  size_t len = MAXPATHLEN;
+  size_t len = PATH_MAX;
   char *buf = xcalloc (len, sizeof (char));
   char *path;
 
@@ -55,7 +55,7 @@ fbsd_pid_to_exec_file (int pid)
 #endif
 
   path = xstrprintf ("/proc/%d/file", pid);
-  if (readlink (path, buf, MAXPATHLEN) == -1)
+  if (readlink (path, buf, PATH_MAX - 1) == -1)
     {
       xfree (buf);
       buf = NULL;
@@ -125,7 +125,7 @@ fbsd_find_memory_regions (find_memory_region_ftype func, void *obfd)
        {
          fprintf_filtered (gdb_stdout, 
                            "Save segment, %ld bytes at %s (%c%c%c)\n",
-                           size, paddress (target_gdbarch, start),
+                           size, paddress (target_gdbarch (), start),
                            read ? 'r' : '-',
                            write ? 'w' : '-',
                            exec ? 'x' : '-');