~ubuntu-branches/ubuntu/utopic/parted/utopic-proposed

« back to all changes in this revision

Viewing changes to build-aux/mktempd

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-07-21 10:23:16 UTC
  • mfrom: (7.2.32 sid)
  • Revision ID: package-import@ubuntu.com-20140721102316-jsyv3yzmbo8vlde5
Tags: 3.1-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
# Create a temporary directory, much like mktemp -d does.
3
3
 
4
 
# Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
4
# Copyright (C) 2007-2012 Free Software Foundation, Inc.
5
5
 
6
6
# This program is free software: you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License as published by
44
44
  dev_rand=/dev/urandom
45
45
  if test -r "$dev_rand"; then
46
46
    # Note: 256-length($chars) == 194; 3 copies of $chars is 186 + 8 = 194.
47
 
    dd ibs=$n count=1 if="$dev_rand" | tr -c $chars 01234567$chars$chars$chars
 
47
    dd ibs=$n count=1 if="$dev_rand" 2>/dev/null \
 
48
      | tr -c $chars 01234567$chars$chars$chars
48
49
    return
49
50
  fi
50
51