Print this page
9718 update mandoc to 1.14.4

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mandoc/tag.c
          +++ new/usr/src/cmd/mandoc/tag.c
   1      -/*      $Id: tag.c,v 1.18 2017/02/17 14:31:52 schwarze Exp $ */
        1 +/*      $Id: tag.c,v 1.19 2018/02/23 16:47:10 schwarze Exp $ */
   2    2  /*
   3    3   * Copyright (c) 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
   4    4   *
   5    5   * Permission to use, copy, modify, and distribute this software for any
   6    6   * purpose with or without fee is hereby granted, provided that the above
   7    7   * copyright notice and this permission notice appear in all copies.
   8    8   *
   9    9   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10   10   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11   11   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
↓ open down ↓ 194 lines elided ↑ open up ↑
 206  206                          for (i = 0; i < entry->nlines; i++)
 207  207                                  fprintf(stream, "%s %s %zu\n",
 208  208                                      entry->s, tag_files.ofn, entry->lines[i]);
 209  209                  free(entry->lines);
 210  210                  free(entry);
 211  211                  entry = ohash_next(&tag_data, &slot);
 212  212          }
 213  213          ohash_delete(&tag_data);
 214  214          if (stream != NULL)
 215  215                  fclose(stream);
      216 +        else
      217 +                close(tag_files.tfd);
      218 +        tag_files.tfd = -1;
 216  219  }
 217  220  
 218  221  void
 219  222  tag_unlink(void)
 220  223  {
 221  224          pid_t    tc_pgid;
 222  225  
 223  226          if (tag_files.tcpgid != -1) {
 224  227                  tc_pgid = tcgetpgrp(tag_files.ofd);
 225  228                  if (tc_pgid == tag_files.pager_pid ||
↓ open down ↓ 24 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX