Move the new files to the same places as in automake.
[obnox/wireshark/wip.git] / wiretap / ascendtext.c
index 801a01fe9b4424ac96bbfe6c69497aa685a707e1..569713e0431245966a3c71c873659065e9ba4953 100644 (file)
@@ -176,7 +176,7 @@ found:
 int ascend_open(wtap *wth, int *err, gchar **err_info)
 {
   gint64 offset;
-  struct stat statbuf;
+  ws_statb64 statbuf;
   guint8 buf[ASCEND_MAX_PKT_LEN];
   ascend_pkthdr header;
   gint64 dummy_seek_start;
@@ -235,8 +235,7 @@ int ascend_open(wtap *wth, int *err, gchar **err_info)
      packet's timestamp from the capture file's ctime, which gives us an
      offset that we can apply to each packet.
    */
-  if (fstat(wth->fd, &statbuf) == -1) {
-    *err = errno;
+  if (wtap_fstat(wth, &statbuf, err) == -1) {
     g_free(ascend);
     return -1;
   }
@@ -290,7 +289,7 @@ static gboolean ascend_read(wtap *wth, int *err, gchar **err_info,
       return FALSE;
   if (parse_ascend(wth->fh, buf, &wth->pseudo_header.ascend, &header,
       &(ascend->next_packet_seek_start)) != PARSED_RECORD) {
-    *err = WTAP_ERR_BAD_RECORD;
+    *err = WTAP_ERR_BAD_FILE;
     *err_info = g_strdup((ascend_parse_error != NULL) ? ascend_parse_error : "parse error");
     return FALSE;
   }
@@ -318,6 +317,7 @@ static gboolean ascend_read(wtap *wth, int *err, gchar **err_info,
     if (ascend->inittime > header.secs)
       ascend->inittime -= header.secs;
   }
+  wth->phdr.presence_flags = WTAP_HAS_TS|WTAP_HAS_CAP_LEN;
   wth->phdr.ts.secs = header.secs + ascend->inittime;
   wth->phdr.ts.nsecs = header.usecs * 1000;
   wth->phdr.caplen = header.caplen;
@@ -338,7 +338,7 @@ static gboolean ascend_seek_read(wtap *wth, gint64 seek_off,
     return FALSE;
   if (parse_ascend(wth->random_fh, pd, &pseudo_head->ascend, NULL,
       &(ascend->next_packet_seek_start)) != PARSED_RECORD) {
-    *err = WTAP_ERR_BAD_RECORD;
+    *err = WTAP_ERR_BAD_FILE;
     *err_info = g_strdup((ascend_parse_error != NULL) ? ascend_parse_error : "parse error");
     return FALSE;
   }