Basic apparel maker Hanesbrands recorded a diminished profit in its second quarter despite a slight sales increase, as the company continued to be impacted by historic high cotton costs.